Jump to content
Martin Crawford

Viewport & Custom Plugin

Recommended Posts

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

Share this post


Link to post

Try it on a Design Layer at 1:1 and different scales.

Also try it in a Top Plan view and 3d Views.

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×