Jump to content
Sign in to follow this  
twk

Vectorlab, Handle/Object Types and Sub Types

Recommended Posts

Greetings

There's a great resource on the vectorlabs website, regarding object types;

http://www.vectorlab.info/index.php?title=Object_Types_Commented

The article talks about Object Types and Object SubTypes,

how do you get handles to subtypes?

or subtype objects?

For example, from the dev wiki

http://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix_D

A table shows that,

Sheet Layer Viewport,Section Viewport have subtypes of 506, 507.

However if you check the handle type of a Sheet Layer Viewport using vs.GetTypeN(h) it still returns 122, how do you check the subtype of a viewport?

Kind regards

Tui

Share this post


Link to post

Found it!

On the same vectorlab website :

http://www.vectorlab.info/index.php?title=Category:VectorScript_Subroutines

Many useful routines, am in the process of converting them to python,

trying to figure whats the best way to setup the modules, via classes by category or modules by category..

will post updates when done, thankgs again Orso.

The subtype was actually a workaround? i think

{ Orso *********************************************** }
{ returns the type or subtype of an object as integer }
FUNCTION H_SubType(h : HANDLE): INTEGER;
BEGIN
	H_SubType := Str2Num(EvalStr(h, (IF(((ST)=-1), (T), (ST)))));
END;

my conversion attempt to python

def sub_objType(h):
   crit_check = "IF((ST)=-1, (T), (ST))"
   num = vs.Eval(h, (crit_check))
   h_subtype = int(num)
   return h_subtype

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...