KDuhme wrote: ↑Tue Aug 09, 2022 5:18 am
Is there a known problem when trying to use this function with version 0.20? I have used the exportStep() Function before to export Compounds and it worked like a charm. But using this function I cannot change the color beforehand.
Welcome to the forum, I'm not aware of a problem with the function but I think you maybe have been caught out by the folder separators, have a look at my successfully tested version with a fairly large Step assembly:
Code: Select all
import Import
importTest = Import.open(r"E:/Data/FreeCAD/Steps/R3-4109PL-TT10-Main frame assembly.STEP")
objs = FreeCAD.ActiveDocument.Objects
Import.export(objs,r"E:/Data/FreeCAD/Parts/ForumExamples/StepWithRandomColours_Test.step")
I believe if you use Windows '\' (backslash) then they have to be escaped out which basically means you have to use double backslashes so it's easier IMHO just to use forward slashes as shown in the Python Console when you do the Gui equivalent.
Code: Select all
OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29396 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: b2fe784efdcbf062b32e2832b4f42743d2d15edb
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods:
* A2plus 0.4.56a
* Assembly3 0.11.3
* CfdOF 1.17.7
* Curves 0.5.4
* fasteners 0.3.51
* fcgear 1.0.0
* freecad.xray 2022.4.17
* Manipulator 1.4.9
* Plot 2022.4.17
* sheetmetal 0.2.56
* Silk 1.0.0