Search found 2764 matches

by keithsloan52
Fri Mar 22, 2024 8:55 am
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 1839
Views: 442807

Export to 3DM

I am trying to create a FreeCAD module for exporting 3DM files see https://github.com/KeithSloan/ImportExport_3DM (Note: ReadME is at a very early stage, basically a copy of https://github.com/KeithSloan/ImportNURBS I am trying to add code for converting Curves to Nurbs and testing with LogSnail_4.F...
by keithsloan52
Mon Mar 18, 2024 7:18 pm
Forum: Python scripting and macros
Topic: Get getGlobalPlacement for a Link.
Replies: 25
Views: 19966

Re: Get getGlobalPlacement for a Link.

>>> help(UtilsAssembly.getGlobalPlacement) Help on function getGlobalPlacement in module UtilsAssembly: getGlobalPlacement(targetObj, container=None) # The container is used to support cases where the same object appears at several places # which happens when you have a link to a part. I'm guessing...
by keithsloan52
Sat Mar 16, 2024 7:57 pm
Forum: Python scripting and macros
Topic: Get getGlobalPlacement for a Link.
Replies: 25
Views: 19966

Re: Get getGlobalPlacement for a Link.

Okay Changed to #s = Part.getShape(t[1], mat=t[1].getGlobalPlacement().Matrix, transform=False) o = t[1] gp = UtilsAssembly.getGlobalPlacement(o) matGP = gp.Matrix s = Part.getShape(o, mat=matGP, transform=False) And that runs at least. Still like to know what the "mat=" is all about? See...
by keithsloan52
Sat Mar 16, 2024 4:39 pm
Forum: Python scripting and macros
Topic: Get getGlobalPlacement for a Link.
Replies: 25
Views: 19966

Re: Get getGlobalPlacement for a Link.

Okay Changed to #s = Part.getShape(t[1], mat=t[1].getGlobalPlacement().Matrix, transform=False) o = t[1] gp = UtilsAssembly.getGlobalPlacement(o) matGP = gp.Matrix s = Part.getShape(o, mat=matGP, transform=False) And that runs at least. Still like to know what the "mat=" is all about?
by keithsloan52
Sat Mar 16, 2024 3:51 pm
Forum: Python scripting and macros
Topic: Get getGlobalPlacement for a Link.
Replies: 25
Views: 19966

Re: Get getGlobalPlacement for a Link.

Okay I have been advised that the New Assembly workbench in FC 0.22 has a version of getGlobalPlacement that works with Linked objects. I am trying to make an appropriate change to a statement in a Macro that worked but not with Linked Objects. The statement is Part.getShape(t[1], mat=t[1].getGlobal...
by keithsloan52
Fri Mar 08, 2024 10:37 pm
Forum: Python scripting and macros
Topic: Enumerate Property
Replies: 6
Views: 545

Re: Enumerate Property

I still don't understand. Maybe this?: obj.getEnumerationsOfProperty("ThePropertyName").index(obj.ThePropertyName) My understanding of an Enumeration is that it is a selection list, what is needed is a selection list AND and an ability to have an item which is an Integer that you can inpu...
by keithsloan52
Fri Mar 08, 2024 2:18 pm
Forum: Python scripting and macros
Topic: Enumerate Property
Replies: 6
Views: 545

Re: Enumerate Property

Not sure what you want actually. But with ungrouped enumerations you can do this: obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") obj.Label = "User-friendly label" obj.addProperty("App::PropertyEnumeration", "ThePropert...
by keithsloan52
Fri Mar 08, 2024 10:30 am
Forum: Python scripting and macros
Topic: Enumerate Property
Replies: 6
Views: 545

Re: Enumerate Property

Not sure that helps Need to have a property that is a enumeration list obj.addProperty( "App::PropertyEnumeration", "finish", "GDMLoptical" "finish" ) obj.finish = [ "polished | polished", # smooth perfectly polished surface "polished | frontpai...
by keithsloan52
Fri Mar 08, 2024 8:39 am
Forum: Python scripting and macros
Topic: Enumerate Property
Replies: 6
Views: 545

Enumerate Property

Is there a way to have a property as an enumerate ( Text list of values ) or a numerical value?

i.e. A way for the use to select from the list or enter a numerical value.

Or the only way to implement is to have two properties, one enumerate and one integer?
by keithsloan52
Thu Feb 29, 2024 7:37 pm
Forum: Python scripting and macros
Topic: Dealing with OBJ files.
Replies: 1
Views: 355

Re: Dealing with OBJ files.

If I code something like the following, I can quickly find the lines which start with the sequences I am interested in but rather than just finding the actual sequence, is there a way to return the rest of the line i.e. upto '\n' using something like regex or similar. def processOBJ(doc, filename): ...