Need help, or want to share a macro? Post here!
-
JorgeFernandes
- Posts: 74
- Joined: Sun May 07, 2023 12:18 pm
Post
by JorgeFernandes »
Hi everyone.
How can I export a loaded step as a .dae file?
Code: Select all
path = 'bim.step'
s = Part.Shape()
s.read(path)
To stl I can do:
Is there something similar to date?
My system:
Code: Select all
OS: Ubuntu 22.04.2 LTS (ubuntu:GNOME/ubuntu-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
Thanks in advance.
-
Roy_043
- Veteran
- Posts: 8552
- Joined: Thu Dec 27, 2018 12:28 pm
Post
by Roy_043 »
If you do the export manually, you will see usable Python code in the Python console.
-
JorgeFernandes
- Posts: 74
- Joined: Sun May 07, 2023 12:18 pm
Post
by JorgeFernandes »
Roy_043 wrote: ↑Wed May 24, 2023 7:59 pm
If you do the export manually, you will see usable Python code in the Python console.
Thanks for the reply.
I already try that but I can't figure out the proper way to make it work.
-
Roy_043
- Veteran
- Posts: 8552
- Joined: Thu Dec 27, 2018 12:28 pm
Post
by Roy_043 »
Code: Select all
import Part
import importDAE
path = "C:/Downloads/Test.step"
s = Part.Shape()
s.read(path)
obj = Part.show(s) # Create a document object.
importDAE.export([obj], "C:/Downloads/Test.dae")
-
JorgeFernandes
- Posts: 74
- Joined: Sun May 07, 2023 12:18 pm
Post
by JorgeFernandes »
Roy_043 wrote: ↑Wed May 24, 2023 8:15 pm
Code: Select all
import Part
import importDAE
path = "C:/Downloads/Test.step"
s = Part.Shape()
s.read(path)
obj = Part.show(s) # Create a document object.
importDAE.export([obj], "C:/Downloads/Test.dae")
Thanks a lot. I'll try it and see if it works.
-
JorgeFernandes
- Posts: 74
- Joined: Sun May 07, 2023 12:18 pm
Post
by JorgeFernandes »
Roy_043 wrote: ↑Wed May 24, 2023 8:15 pm
Code: Select all
import Part
import importDAE
path = "C:/Downloads/Test.step"
s = Part.Shape()
s.read(path)
obj = Part.show(s) # Create a document object.
importDAE.export([obj], "C:/Downloads/Test.dae")
This works perfectly. Thanks again for the help.
I have another question:
I can change the resolution, how can I do that with code?