| AddResourceToList | Document List Handling |
Declaration:
FUNCTION AddResourceToList
( listID :LONGINT; resource :HANDLE ) :LONGINT ; Description:
Adds the indicated resource to the specified resource list, if it is of the same type as the items already in the list. Returns the index of the resource in the list or 0.Parameters:
listID an ID for a resource list created by the BuildResourceList command. resource a resource to add to the resource list. Example:
{ Create a new hatch and add it to the resource list. } hatchName := 'Hatch-1'; BeginVectorFillN(hatchName, true, false, 0); AddVectorFillLayer(0, 0, 1, 1, .25, -.25, .7, 3, 255); EndVectorFill; newHatch := GetObject(hatchName); index := AddResourceToList(listID, newHatch);
| BuildResourceList | Document List Handling |
Declaration:
FUNCTION BuildResourceList
( type :INTEGER; folderIndex :INTEGER; subFolderName :STRING; VAR numItems :LONGINT ) :LONGINT ; Description:
Creates an implicit list of resources of a specified type, and returns an ID for the list. Values in the list can be retrieved using GetNameFromResourceList.
If the Display Default Content preference (#130) is on and folderIndex is not 0, it will also include all the resources of the specified type in all the files in the selected folder.
If folderIndex is positive, the list will include all the resources of that type from the current document, as well as from the specified folder. If folderIndex is 0, only the resources in the current document will be in the list. If folderIndex is negative, only the resources in the specified folder will be in the list.
A complete listing of supported object types may be found in the Appendix.
Table - Folder Path Selectors
Note that use of the negative values of these constants can be used to get the user-based folder path. The positive values are for application-based paths, which should not be used for writing.
Folder Name Constant Application 1 Plug-Ins 2 Workspaces 4 Templates 7 Standards 8 Help 9 Dictionaries 10 User App Data 12 Libraries 13 Defaults 14 Settings 15 PDF Resources 18 Plug-In Data 20 Plug-In Includes 21 Plug-In interfaces 22 Favorites 23 Renderworks - Textures 100 Cabinet - Handles 101 Door - Hardware 102 Attributes - Gradients 103 Hardscape - Hatches 104 Attributes - Hatches 105 Attributes - Image Fills 106 Plants 107 Toilet Stall - Fixtures 108 RenderWorks - Backgrounds 109 Seating Layout - Symbols 110 Tile - Symbols 111 Human Figure - Textures 112 Walls 113 Stairs 114 Drawing Border - Title Blocks 115 Section - Markers 116 Repetitive Unit 117 Door - Custom Leaves 118 Lighting Instrument - Gobos 119 Reports~Schedules 120 Lighting Instrument - Symbols 121 Plants - Hatches 124 Repetivite Unit: Flooring/Decking 125 Repetivite Unit: Framing 126 Repetivite Unit: Masonry Units 127 Repetivite Unit: Miscellaneous 128 Repetivite Unit: Roofing 129 Repetivite Unit: Siding 130 Walls - Hatches 131 Walls - Textures 132 Window - Custom Shutters 133 Sketch Styles 134 Plant Database 135 VW Plants 136 Color Palettes 137 Framing Member - Custom Profile 138 Spaces - Occupant Organization Name Lists 140 Spaces - Space Name Lists and Libraries 141 Structural Shapes 142 Parameters:
type the type of resource to put in the list folderIndex the index of a VW folder. subFolderName the name of a subfolder inside the folder specified by folderIndex. This can also be a partial path. Use an empty string to request the resources from all files in the folderIndex folder. numItems the number of items in the list built Example:
const kHatch = 66; kDefHatchFolder = 105; var listID, numItems: LONGINT; begin { Create a resource list of hatches from the current document and } { the default hatch folder. } listID := BuildResourceList(kHatch, kDefHatchFolder, '', numItems);See Also:
AddResourceToList DeleteResourceFromList GetNameFromResourceList GetResourceFromList ImportResourceToCurrentFile
| DeleteResourceFromList | Document List Handling |
Declaration:
PROCEDURE DeleteResourceFromList
( listID :LONGINT; index :LONGINT ) ; Description:
Deletes the indicated object in the specified resource list.Parameters:
listID an ID for a resource list created by the BuildResourceList function. index an index into the list. Example:
hatchName := GetNameFromResourceList(listID, index); if (pos('P', hatchName) = 1) then DeleteResourceFromList(listID, index)
| FActLayer | Document List Handling |
Declaration:
FUNCTION FActLayer
:HANDLE ; Description:
Function FActLayer returns a handle to the first object on the active layer. If the object does not exist, the function returns NIL.
| FIn3D | Document List Handling |
Declaration:
FUNCTION FIn3D
( objectHd:HANDLE ) :HANDLE ; Description:
Function FIn3D returns a handle to the first component object in the referenced 3D object definition.Parameters:
objectHd Handle to object.
| FInFolder | Document List Handling |
Declaration:
FUNCTION FInFolder
( sfHd:HANDLE ) :HANDLE ; Description:
Function FInFolder returns a handle to the first object in the referenced symbol folder. The object can be either a symbol definition or a nested symbol folder.
If the folder is empty, the function returns NIL.
Parameters:
sfHd Handle to symbol definition or symbol folder.
| FInGroup | Document List Handling |
Declaration:
FUNCTION FInGroup
( ObjectHd:HANDLE ) :HANDLE ; Description:
Function FInGroup returns a handle to the first component object of the referenced group.
Parameters:
ObjectHd Handle to group object. Example:
PROCEDURE Example; VAR h :HANDLE; BEGIN h := FInGroup(FSActLayer); WHILE h <> NIL DO BEGIN SetClass(h, 'None'); h := NextObj(h); END; END; RUN(Example);
| FInLayer | Document List Handling |
Declaration:
FUNCTION FInLayer
( h:HANDLE ) :HANDLE ; Description:
Function FInLayer returns a handle to the first object within the referenced layer. If the layer is empty, the function returns NIL.
Parameters:
h Handle to layer.
| FInSymDef | Document List Handling |
Declaration:
FUNCTION FInSymDef
( sdHd:HANDLE ) :HANDLE ; Description:
Function FInSymDef returns a handle to the first component object within the referenced symbol definition.
Parameters:
sdHd Handle to symbol definition.
| FObject | Document List Handling |
Declaration:
FUNCTION FObject
:HANDLE ; Description:
Function FObject returns a handle to the first object in the active document. If the document is empty, the function returns NIL.
| FSActLayer | Document List Handling |
Declaration:
FUNCTION FSActLayer
:HANDLE ; Description:
Function FSActLayer returns a handle to the first selected object on the active layer. If no objects are selected, the function returns NIL.
| FSObject | Document List Handling |
Declaration:
FUNCTION FSObject
( h:HANDLE ) :HANDLE ; Description:
Function FSObject returns the handle to the first selected object in the referenced layer. If no objects are selected, the function returns NIL.
Parameters:
h Handle to layer.
| FSymDef | Document List Handling |
Declaration:
FUNCTION FSymDef
:HANDLE ; Description:
Function FSymDef returns a handle to the first symbol definition in the current document's symbol library. If the symbol library is empty, the function returns NIL.
| GetActualNameFromResourceList | Document List Handling |
Declaration:
FUNCTION GetActualNameFromResourceList
( listID :LONGINT; index :LONGINT ) :STRING ; Description:
Returns the actual name of the indicated item in the specified resource list. This call will delete the filename that is appended for resources with same name from different files.
Parameters:
listID an ID for a resouce list created by the BuildResourceList function. index an index into the list. Example:
displayName := GetActualNameFromResourceList(listID, index);See Also:
GetNameFromResourceList
| GetNameFromResourceList | Document List Handling |
Declaration:
FUNCTION GetNameFromResourceList
( listID :LONGINT; index :LONGINT ) :STRING ; Description:
Returns the name to display of the indicated item in the specified resource list. If the list has items with the same name from different files, the display name will have the filename added to it in parentheses.Parameters:
listID an ID for a resouce list created by the BuildResourceList function. index an index into the list. Example:
hatchName := GetNameFromResourceList(listID, index); if (pos('P', hatchName) = 1) then DeleteResourceFromList(listID, index)See Also:
GetActualNameFromResourceList
| GetResourceFromList | Document List Handling |
Declaration:
FUNCTION GetResourceFromList
( listID :LONGINT; index :LONGINT ) :HANDLE ; Description:
Returns the indicated resource from the indicated resource list, if the resource is in the current document. Otherwise it returns nil.Parameters:
listID an ID for a resource list created by the BuildResourceList command. index an index into the list. Example:
hatch := GetResourceFromList(listID, index); if (hatch = NIL) then hatch := ImportResourceToCurrentFile(listID, index);
| ImportResourceToCurrentFile | Document List Handling |
Declaration:
FUNCTION ImportResourceToCurrentFile
( listID :LONGINT; index :LONGINT ) :HANDLE ; Description:
Imports the indicated resource from the specified list to the current file, if it is not already in the current file, and returns the handle to the resource.Parameters:
listID an ID for a resource list created by the BuildResourceList command. index an index into the list. Example:
hatch := GetResourceFromList(listID, index); if (hatch = NIL) then hatch := ImportResourceToCurrentFile(listID, index);
| LActLayer | Document List Handling |
Declaration:
FUNCTION LActLayer
:HANDLE ; Description:
Function LActLayer returns a handle to the last object in the active layer.
| LNewObj | Document List Handling |
Declaration:
FUNCTION LNewObj
:HANDLE ; Description:
Returns a handle to the last object created by a VectorScript function call during the current script execution.
Result:
Returns a HANDLE to the most recently created object, otherwise returns NIL.
| LObject | Document List Handling |
Declaration:
FUNCTION LObject
:HANDLE ; Description:
Function LObject returns a handle to the last object in the active document.
| LSActLayer | Document List Handling |
Declaration:
FUNCTION LSActLayer
:HANDLE ; Description:
Function LSActLayer returns a handle to the last selected object on the active layer. If no objects are selected, the function returns NIL.
| NextDObj | Document List Handling |
Declaration:
FUNCTION NextDObj
( h:HANDLE ) :HANDLE ; Description:
Function NextDObj returns the next deselected object after the referenced object in a list. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object. Example:
handleToObject:=FObject; WHILE handleToObject <> NIL DO BEGIN SetSelect(handleToObject); handleToObject:=NextDObj(handleToObject); END; { selects all deselected objects }
| NextLayer | Document List Handling |
Declaration:
FUNCTION NextLayer
( h:HANDLE ) :HANDLE ; Description:
Function NextLayer returns a handle to the next layer in the document after the referenced. If the end of the list has been reached, the function returns NIL.
Parameters:
h Handle to layer. Example:
handleToLayer:=FLayer; WHILE handleToLayer <> NIL DO BEGIN SysBeep; handleToLayer:=NextLayer(handleToLayer); END; { will process through all the layers in the list }
| NextObj | Document List Handling |
Declaration:
FUNCTION NextObj
( h:HANDLE ) :HANDLE ; Description:
Function NextObj returns the next object in any list . If the end of the list is reached, the function returns NIL. This procedure can be used with other handle routines such as FirstIn3D,FInGroup, FirstInSymDef, or FLayer.
Parameters:
h Handle to object, group, or symbol definition. Example:
handleToObject:=FObject; WHILE handleToObject <> NIL DO BEGIN i:=i+1; handleToObject:=NextObj(handleToObject); END;
| NextSObj | Document List Handling |
Declaration:
FUNCTION NextSObj
( h:HANDLE ) :HANDLE ; Description:
Function NextSObj returns the next selected object in a list. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object.
| NextSymDef | Document List Handling |
Declaration:
FUNCTION NextSymDef
( symHd:HANDLE ) :HANDLE ; Description:
Function NextSymDef returns a handle to the next definition in the symbol library after the referenced symbol. If the end of the list has been reached, the function returns NIL.
Parameters:
symHd Handle to symbol definition in library.
| PrevDObj | Document List Handling |
Declaration:
FUNCTION PrevDObj
( h:HANDLE ) :HANDLE ; Description:
Function PrevDObj returns the previous deselected object in a list of objects . If the end of the object list is reached, the function returns NIL.
Parameters:
h Handle to object.
| PrevLayer | Document List Handling |
Declaration:
FUNCTION PrevLayer
( h:HANDLE ) :HANDLE ; Description:
Function PrevLayer returns a handle to the layer in the document preceding the referenced layer.Parameters:
h Handle to layer.
| PrevObj | Document List Handling |
Declaration:
FUNCTION PrevObj
( h:HANDLE ) :HANDLE ; Description:
Function PrevObj returns the object in any list which precedes the specified object. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object, group, or symbol definition.
| PrevSObj | Document List Handling |
Declaration:
FUNCTION PrevSObj
( h:HANDLE ) :HANDLE ; Description:
Function PrevSObj returns the previous selected object in the list preceding the referenced object.
Parameters:
h Handle to object.
| PrevSymDef | Document List Handling |
Declaration:
FUNCTION PrevSymDef
( symHd:HANDLE ) :HANDLE ; Description:
Function PrevSymDef returns a handle to the symbol definition in the symbol library preceding the referenced definition.
Parameters:
symHd Handle to symbol definition.
| ResourceListSize | Document List Handling |
Declaration:
FUNCTION ResourceListSize
( listID:LONGINT ) :LONGINT ; Description:
Returns the number of items in the specified resource list.Parameters:
listID an ID for a resouce list created by the BuildResourceList function. Example:
{ Update numItems as the number of items in the resource list has } { changed. } numItems := ResourceListSize(listID);
| SetParent | Document List Handling |
Declaration:
FUNCTION SetParent
( obj :HANDLE; container :HANDLE ) :BOOLEAN ; Description:
Removes the object from its current container and places it within the given container. For example, SetParent can be used to put the referenced object into a group, or into a symbol definition, or to change the layer of the referenced object.Parameters:
obj Handle to the object to move. container Handle to the object that will become the parent of the obj variable. Example:
PROCEDURE SetParentExample; VAR h1, h2 :HANDLE; boo :BOOLEAN; BEGIN h1 := FSActLayer; h2 := NextObj(h1); boo := SetParent(h2, h1); END; RUN(SetParentExample);See Also:
CreateDuplicateObject