Use GetResources from command class without creating an object?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Use GetResources from command class without creating an object?

Post by Roy_043 »

This is probably a bit strange. I am not interested in creating an object, all I need is the strings from the GetResources function of a command class.

Code: Select all

import draftguitools.gui_snaps as gui_snaps
cmd_class = getattr(gui_snaps, "Draft_Snap_Angle")

# Which is better/more efficient?:
cmd_class.GetResources("")

# Or:
cmd_class().GetResources()
# Should I delete the object here?
Post Reply