Martin Crawford Posted July 26, 2018 Share Posted July 26, 2018 I have a custom plugin that I am using and I would like to know if there is a way to determine if the the plugin is being created inside of a viewport annotation. I have different math depending on where the plug-in is used. Thanks Martin Quote Link to comment
bcd Posted July 26, 2018 Share Posted July 26, 2018 Try it on a Design Layer at 1:1 and different scales. Also try it in a Top Plan view and 3d Views. Quote Link to comment
JBenghiat Posted July 26, 2018 Share Posted July 26, 2018 This should do it: http://developer.vectorworks.net/index.php/VS:IsVPGroupContainedObject Quote Link to comment
Martin Crawford Posted July 26, 2018 Author Share Posted July 26, 2018 Typically I start the tool when I am already inside the viewport, is there a way to tell if I'm already in the viewport? Or How do I get a handle to an object as at the beginning of the tool, I haven't drawn anything. Does my question make sense? Thanks Martin Quote Link to comment
JBenghiat Posted July 26, 2018 Share Posted July 26, 2018 If you want to find out where you are, using the "waldo" technique is usually effective. Search the forms for waldo. Essentially, create a locus, get its handle, get its parent, then delete the locus. The above works for a menu command. If this is a plug-in object, GetPluginObjectInfo will get a handle to the currently executing plug-in. The get the plug-in's parent. A nil parent indicates that the plug-in is in preview mode, about to be inserted. Quote Link to comment
Martin Crawford Posted July 26, 2018 Author Share Posted July 26, 2018 Brillant! Thanks! 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.