Search found 2756 matches

by keithsloan52
Thu Mar 28, 2024 8:54 am
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 1824
Views: 426299

Re: Curves workbench

Okay I am trying to understand the info I am getting from a Surface. i.e. Obj.Shape.Faces[x].Surface print(dir(surface)) 08:06:33 ['Content', 'Continuity', 'FirstUKnotIndex', 'FirstVKnotIndex', 'LastUKnotIndex', 'LastVKnotIndex', 'MaxDegree', 'MemSize', 'Module', 'NbUKnots', 'NbUPoles', 'NbVKnots', ...
by keithsloan52
Sat Mar 23, 2024 5:03 pm
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 1824
Views: 426299

Re: Curves workbench

It does not seem to matter how I access e.Curve I get an error <class 'TypeError'>: undefined curve type This error appears on degenerated edges (length=0, only 1 vertex). On RotationSweep, this faulty edge is the rotation center of the swept profiles. This same error also appears for example on th...
by keithsloan52
Fri Mar 22, 2024 8:55 am
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 1824
Views: 426299

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: 24
Views: 19126

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: 24
Views: 19126

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: 24
Views: 19126

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: 24
Views: 19126

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: 501

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: 501

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: 501

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...