michaelk Posted May 10, 2020 Share Posted May 10, 2020 I'm doing some experiments. Trying to see if I can get the handle to a viewport starting with the handle of an object in the annotation space of that viewport. GetTypeN(GetParent(h) ) returns 11 (Group) GetTypeN of the parent of the above object returns type 32. Type 32 isn't in the index but it's in the example code for GetType (not GetTypeN) as a header. Is that object type outdated? Why doesn't it return type 122 (viewport)? What method do I need to do to get the viewport handle? …and what's a header? I don't see anything in the function reference that describes what a header is. Quote Link to comment
twk Posted May 10, 2020 Share Posted May 10, 2020 (edited) The parent of an object in the annotation space is the Annotation Group (Type 11=Group), Viewports have multiple components of itself > Eg. https://developer.vectorworks.net/index.php/VS:GetVPGroup To get the Viewport you use GetVPGroupParent (https://developer.vectorworks.net/index.php/VS:GetVPGroupParent). -edit- as to what a Header type is, I don't know. Full type list of objects is in the C++ SDK. Edited May 10, 2020 by twk 2 Quote Link to comment
michaelk Posted May 10, 2020 Author Share Posted May 10, 2020 21 minutes ago, twk said: as to what a Header type is, I don't know. 🤣 Thanks!! Quote Link to comment
JBenghiat Posted May 11, 2020 Share Posted May 11, 2020 GetType and GetTypeN return the same constants. When VW introduces the concepts of planar objects (as opposed to 2D objects that were always in the screen plane), the way object types were stored needed to be changed, so the new version is more reliable in the current version of VW. Other than the behind-the-scenes change, the commands are identical. The drawing header is the object that contains layers. You can't get a higher parent level than the header. It also contains everything that's not on a layer: resources, preferences, dimension styles, etc. 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.