http://developer.vectorworks.net/index.php?title=VS:GetType&feed=atom&action=history
VS:GetType - Revision history
2024-03-28T15:59:33Z
Revision history for this page on the wiki
MediaWiki 1.41.0
http://developer.vectorworks.net/index.php?title=VS:GetType&diff=3871&oldid=prev
Root: 1 revision
2013-08-12T14:33:03Z
<p>1 revision</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:33, 12 August 2013</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Root
http://developer.vectorworks.net/index.php?title=VS:GetType&diff=3870&oldid=prev
Rgm at 05:28, 15 January 2013
2013-01-15T05:28:17Z
<p></p>
<p><b>New page</b></p><div>{{LocationMain|category=LocationVS|specific=}}<br />
__TOC__<br />
<vwDoc><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<desc><br />
DON'T USE THIS ANYMORE. Switch over to [[VS:GetTypeN| GetTypeN]].<br />
<br />
Returns the type index of the referenced object.<br />
<br />
A complete listing of supported object types may be found in the [[VS:Function_Reference_Appendix#Object_Types| Appendix]].<br />
<br />
</desc><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<def><br />
<funcDef lang="vs"><br />
FUNCTION GetType(h:HANDLE) : INTEGER;<br />
</funcDef><br />
<funcDef lang="py"><br />
def vs.GetType(h):<br />
return INTEGER<br />
</funcDef><br />
</def><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<params><br />
<lineList ident=1><br />
<line><br />
h<br />
HANDLE<br />
Handle to object.<br />
</line><br />
</lineList><br />
</params><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<return><br />
Returns the node type of the referenced object.<br />
</return><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<remarks><br />
GetType doesn't return subTypes (see the [[VS:Function Reference Appendix#Object Subtypes|Appendix, 'Object Subtypes']]). This is a pity since many objects are difficult to identify by type. For example a Viewport on Design Layer resolves as type 86 (plug-in). It will contain at least an instance of 29 (layer link), but who knows which other plug-in objects might do it as well.<br />
<br />
A commented list of Object Types is to be found at <br />
&lt;a href=http://www.vectorlab.info/index.php?title=Object_Types_Commented&gt;VectorLab&lt;/a&gt;</remark><br />
</remarks><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<sample><br />
==== VectorScript ====<br />
<code lang="pas"><br />
PROCEDURE Example;<br />
VAR<br />
str :STRING;<br />
h :HANDLE;<br />
BEGIN<br />
str := StrDialog('Enter the name:', 'Window');<br />
IF NOT DidCancel THEN BEGIN<br />
h := GetObject(str);<br />
IF h <> NIL THEN BEGIN<br />
CASE GetType(h) OF<br />
2: str := 'Line';<br />
3: str := 'Rectangle';<br />
4: str := 'Ellipse';<br />
5: str := 'Polygon';<br />
6: str := 'Arc/Circle';<br />
8: str := 'Freehand Line';<br />
9: str := '3D Locus';<br />
10: str := 'Text';<br />
11: str := 'Group';<br />
12: str := 'Quarter Arc';<br />
13: str := 'Rounded Rectangle';<br />
14: str := 'Image (GIF, JPG, BMP)';<br />
15: str := 'Placed Symbol';<br />
16: str := 'Symbol Definition';<br />
17: str := '2D Locus';<br />
18: str := 'Worksheet';<br />
21: str := 'Polyline';<br />
22: str := 'PICT Image';<br />
24: str := 'Extrude';<br />
25: str := '3D Polygon';<br />
29: str := 'Layer Link';<br />
30: str := 'Dash Pattern';<br />
31: str := 'Layer';<br />
32: str := 'Header';<br />
33: str := 'RefList';<br />
34: str := 'Sweep';<br />
35: str := 'Class List';<br />
38: str := 'Multiple Extrusion';<br />
39: str := 'Dim Standard';<br />
40: str := 'Mesh';<br />
41: str := 'Mesh Vertex';<br />
42: str := 'd33Node';<br />
43: str := 'Saved View';<br />
44: str := 'Render Spec';<br />
45: str := 'EPS';<br />
47: str := 'Record Format';<br />
48: str := 'PIO Record Format';<br />
49: str := 'Saved Sheet';<br />
51: str := 'Script Palette';<br />
54: str := 'SymList';<br />
55: str := 'RefName';<br />
56: str := 'Worksheet Image';<br />
57: str := 'Data';<br />
58: str := 'Linked Text';<br />
59: str := 'Macro';<br />
60: str := 'Worksheet Database';<br />
61: str := 'Worksheet Index';<br />
62: str := 'Worksheet Leader';<br />
63: str := 'Dimension';<br />
64: str := 'stringTD';<br />
65: str := 'Hatch Container';<br />
66: str := 'Hatch';<br />
67: str := 'bspProp';<br />
68: str := 'Wall';<br />
69: str := 'innerLines';<br />
71: str := 'Floor, column, or roof face';<br />
72: str := 'lineCol';<br />
74: str := 'fontTable';<br />
76: str := 'userData';<br />
77: str := 'workingPlane';<br />
78: str := 'wpList';<br />
79: str := 'PatList';<br />
80: str := 'ColorPalette';<br />
81: str := 'Light';<br />
82: str := 'Roof Edge';<br />
83: str := 'Roof';<br />
84: str := 'Solid CSG (addition, subtraction, union)';<br />
85: str := 'BoundaryRep';<br />
86: str := 'Plug-In Object';<br />
87: str := 'Roof Dormer';<br />
88: str := 'Subscribe';<br />
89: str := 'Rounded Wall';<br />
90: str := 'UndoPlaceholder';<br />
91: str := 'TextureSpace';<br />
92: str := 'Symbol Folder';<br />
93: str := 'Texture';<br />
94: str := 'Class';<br />
95: str := 'Solid (sphere, hemisphere, cone)';<br />
97: str := 'Texture Definition';<br />
98: str := 'ADSymDefHandler';<br />
99: str := 'ADSymbolHandler';<br />
110: str := 'Constraint';<br />
111: str := 'NURBS Curve';<br />
112: str := 'CorePrintInfo';<br />
113: str := 'NURBS Surface';<br />
114: str := 'CompositeSurface';<br />
115: str := 'RenderBackground';<br />
116: str := 'PolyBreak';<br />
117: str := 'BatchRenderJob';<br />
118: str := 'BatchRenderJobList';<br />
119: str := 'Image Fill Definition';<br />
120: str := 'Gradient Fill Definition';<br />
121: str := 'Fill Space';<br />
122: str := 'Viewport';<br />
123: str := 'Render Style';<br />
124: str := 'Association';<br />
127: str := 'Wall Style';<br />
END;<br />
AlrtDialog(Concat('Object is a ', str));<br />
END;<br />
END;<br />
END;<br />
RUN(Example);<br />
</code><br />
==== Python ====<br />
<code lang="py"><br />
def Example():<br />
objectTypes = {<br />
2: 'Line',<br />
3: 'Rectangle',<br />
4: 'Ellipse',<br />
5: 'Polygon',<br />
6: 'Arc/Circle',<br />
8: 'Freehand Line',<br />
9: '3D Locus',<br />
10: 'Text',<br />
11: 'Group',<br />
12: 'Quarter Arc',<br />
13: 'Rounded Rectangle',<br />
14: 'Image (GIF, JPG, BMP)',<br />
15: 'Placed Symbol',<br />
16: 'Symbol Definition',<br />
17: '2D Locus',<br />
18: 'Worksheet',<br />
21: 'Polyline',<br />
22: 'PICT Image',<br />
24: 'Extrude',<br />
25: '3D Polygon',<br />
29: 'Layer Link',<br />
30: 'Dash Pattern',<br />
31: 'Layer',<br />
32: 'Header',<br />
33: 'RefList',<br />
34: 'Sweep',<br />
35: 'Class List',<br />
38: 'Multiple Extrusion',<br />
39: 'Dim Standard',<br />
40: 'Mesh',<br />
41: 'Mesh Vertex',<br />
42: 'd33Node',<br />
43: 'Saved View',<br />
44: 'Render Spec',<br />
45: 'EPS',<br />
47: 'Record Format',<br />
48: 'PIO Record Format',<br />
49: 'Saved Sheet',<br />
51: 'Script Palette',<br />
54: 'SymList',<br />
55: 'RefName',<br />
56: 'Worksheet Image',<br />
57: 'Data',<br />
58: 'Linked Text',<br />
59: 'Macro',<br />
60: 'Worksheet Database',<br />
61: 'Worksheet Index',<br />
62: 'Worksheet Leader',<br />
63: 'Dimension',<br />
64: 'stringTD',<br />
65: 'Hatch Container',<br />
66: 'Hatch',<br />
67: 'bspProp',<br />
68: 'Wall',<br />
69: 'innerLines',<br />
71: 'Floor, column, or roof face',<br />
72: 'lineCol',<br />
74: 'fontTable',<br />
76: 'userData',<br />
77: 'workingPlane',<br />
78: 'wpList',<br />
79: 'PatList',<br />
80: 'ColorPalette',<br />
81: 'Light',<br />
82: 'Roof Edge',<br />
83: 'Roof',<br />
84: 'Solid CSG (addition, subtraction, union)',<br />
85: 'BoundaryRep',<br />
86: 'Plug-In Object',<br />
87: 'Roof Dormer',<br />
88: 'Subscribe',<br />
89: 'Rounded Wall',<br />
90: 'UndoPlaceholder',<br />
91: 'TextureSpace',<br />
92: 'Symbol Folder',<br />
93: 'Texture',<br />
94: 'Class',<br />
95: 'Solid (sphere, hemisphere, cone)',<br />
97: 'Texture Definition',<br />
98: 'ADSymDefHandler',<br />
99: 'ADSymbolHandler',<br />
110: 'Constraint',<br />
111: 'NURBS Curve',<br />
112: 'CorePrintInfo',<br />
113: 'NURBS Surface',<br />
114: 'CompositeSurface',<br />
115: 'RenderBackground',<br />
116: 'PolyBreak',<br />
117: 'BatchRenderJob',<br />
118: 'BatchRenderJobList',<br />
119: 'Image Fill Definition',<br />
120: 'Gradient Fill Definition',<br />
121: 'Fill Space',<br />
122: 'Viewport',<br />
123: 'Render Style',<br />
124: 'Association',<br />
127: 'Wall Style'<br />
}<br />
<br />
str = vs.StrDialog('Enter the name:', 'Window')<br />
if not vs.DidCancel():<br />
h = vs.GetObject(str)<br />
if h != None: <br />
vs.AlrtDialog(vs.Concat('Object is a ', objectTypes[vs.GetType(h)]))<br />
<br />
<br />
Example()<br />
</code><br />
</sample><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<version><br />
Availability: from All Versions. Deprecated from VW 2010+.<br />
</version><br />
<br />
-----------------------------------------------------------------------------------------------------------<br />
<seeAlso><br />
From VW 2010+: [[VS:GetTypeN| GetTypeN]]<br />
</seeAlso><br />
<br />
<br />
</vwDoc><br />
<br />
[[Category:VS Function Reference|GetType]]<br />
[[Category:VS Function Reference:Object Info|GetType]]</div>
Rgm