Search found 2753 matches
- Mon Mar 18, 2024 7:18 pm
- Forum: Python scripting and macros
- Topic: Get getGlobalPlacement for a Link.
- Replies: 24
- Views: 18635
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...
- Sat Mar 16, 2024 7:57 pm
- Forum: Python scripting and macros
- Topic: Get getGlobalPlacement for a Link.
- Replies: 24
- Views: 18635
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...
- Sat Mar 16, 2024 4:39 pm
- Forum: Python scripting and macros
- Topic: Get getGlobalPlacement for a Link.
- Replies: 24
- Views: 18635
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?
- Sat Mar 16, 2024 3:51 pm
- Forum: Python scripting and macros
- Topic: Get getGlobalPlacement for a Link.
- Replies: 24
- Views: 18635
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...
- Fri Mar 08, 2024 10:37 pm
- Forum: Python scripting and macros
- Topic: Enumerate Property
- Replies: 6
- Views: 461
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...
- Fri Mar 08, 2024 2:18 pm
- Forum: Python scripting and macros
- Topic: Enumerate Property
- Replies: 6
- Views: 461
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...
- Fri Mar 08, 2024 10:30 am
- Forum: Python scripting and macros
- Topic: Enumerate Property
- Replies: 6
- Views: 461
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...
- Fri Mar 08, 2024 8:39 am
- Forum: Python scripting and macros
- Topic: Enumerate Property
- Replies: 6
- Views: 461
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?
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?
- Thu Feb 29, 2024 7:37 pm
- Forum: Python scripting and macros
- Topic: Dealing with OBJ files.
- Replies: 1
- Views: 308
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): ...
- Mon Feb 26, 2024 2:07 pm
- Forum: Help on using FreeCAD
- Topic: Property Window in FC 0.21.1
- Replies: 2
- Views: 235