Carles Olle Posted November 9, 2016 Share Posted November 9, 2016 Hi, I need some help with custom plug-ins. I created a custom plug-in with a custom point object. It seems to work fine Now I need to create a command that will be executed from a menu that invokes the tool to place the custom point object in the document. I've been looking around but I don't seem to find how to do it. My questions are How to invoke the tool for the custom point object from the command script How to set up the parameters for the custom tool (Height, Width, etc.) for the new object I'm about to create Thanks in advance. Quote Link to comment
MullinRJ Posted November 9, 2016 Share Posted November 9, 2016 You don't need to invoke your tool to place it with a script. Since you coded the object, you know everything about it. Simply PLACE the object, ATTACH the PIO record to it, and FILL in all the record fields with values you want. Here's a VS sample of a bolt object (not a custom object, but the steps are the same). H := CreateCustomObject('Hex Bolt (ISO)', 0, 0.8, #0d); Record(H, 'Hex Bolt (ISO)'); Field(H, 'Hex Bolt (ISO)', 'boltType', 'Hex Bolt'); Field(H, 'Hex Bolt (ISO)', 'size_1', 'M12 X 1,75'); Field(H, 'Hex Bolt (ISO)', '__size_2', 'M12 x 1,75'); Field(H, 'Hex Bolt (ISO)', '__size_3', 'M12 x 1,75'); Field(H, 'Hex Bolt (ISO)', '__size_4', 'M12 x 1,75'); Field(H, 'Hex Bolt (ISO)', 'length', '1.9685'); Field(H, 'Hex Bolt (ISO)', 'threadStyle', 'Simplified'); Field(H, 'Hex Bolt (ISO)', 'view', 'Front'); Field(H, 'Hex Bolt (ISO)', 'drawFillet', 'False'); Field(H, 'Hex Bolt (ISO)', 'stdLength', 'True'); Field(H, 'Hex Bolt (ISO)', 'centerline', 'False'); Field(H, 'Hex Bolt (ISO)', '__oldSize', 'M12 X 1,75'); Field(H, 'Hex Bolt (ISO)', '__oldType', '1'); If that is not enough, then ResetObject(H) when you're done. It should be pretty easy to Pythonize this. HTH, Raymond Quote Link to comment
Carles Olle Posted December 6, 2016 Author Share Posted December 6, 2016 Thanks Raymond, It works like a charm. Quote Link to comment
MullinRJ Posted December 6, 2016 Share Posted December 6, 2016 You're welcome. Good to hear it works. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.