TheMarkster wrote: ↑Tue Aug 06, 2019 2:09 am
Presuming you wish to make changes to Draft.py and submit a Pull Request, I suggest it should be a keyword (named) argument, Name="default" where "default" is the name already given by default, e.g. "Text" or "Wire". ...
This is already possible with a few commands, the problem is that it's not a consistent behavior.
Code: Select all
def makeArray(baseobject,arg1,arg2,arg3,arg4=None,arg5=None,arg6=None,name="Array"):
...
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
Basically, the
addObject() method is responsible for assigning the name. However, the actual name of the object doesn't matter too much; what the user would like to modify is the "label" which is modifiable, unlike the "name" which is fixed.
Something like this.
Code: Select all
def makeArray(baseobject,arg1,arg2,arg3,arg4=None,arg5=None,arg6=None,name="Array"):
...
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Array") # Fixed name
obj.Label = name # variable label
The
Arch Workbench is more flexible in this regard, but the Draft functions were written a long time ago, so they haven't been designed with everything that the Arch functions have.
tobycz wrote: ↑Mon Aug 05, 2019 11:41 pm
I'm happy to help with this.
I'm just not sure what would be good (coordinated) approach.
This should be discussed in the Development forum, where Draft, Arch, and BIM are discussed.