Jump to content
Sign in to follow this  
Sam Jones

Creating symbols

Recommended Posts

I want to make a symbol from a collection of selected drawing objects and

then enter the symbol definition and attach a record to the symbol

definition and enter some default values. I was able to do this in VW 8.5

with the VS chunk below

TypeString := StrDialog('Fixture Default Type','');

WattageString := StrDialog('Fixture Default Wattage','');

DoMenuTextByName('Create Symbol',0);

SymbolHandle := ActSymDef;

SetRecord(SymbolHandle, 'Fixture Data');

SetRField(SymbolHandle, 'Fixture Data','Type',TypeString);

SetRField(SymbolHandle, 'Fixture Data','Wattage',WattageString);

In VW 9.0, this no longer works. It seems that the symbol is not created

until the completion of the script, so the SymbolHandle equals nil and

nothing gets assigned. Is there anyway to do this?

Share this post


Link to post

Sam,

I gave this a try and it worked for me?

It assumes the Fixture Data record format already exists.

------------------------------

Procedure Test;

Var

TypeString,WattageString:STRING;

SymbolHandle:HANDLE;

begin

TypeString := StrDialog('Fixture Default Type','');

WattageString := StrDialog('Fixture Default Wattage','');

DoMenuTextByName('Create Symbol',0);

SymbolHandle := ActSymDef;

SetRecord(SymbolHandle, 'Fixture Data');

SetRField(SymbolHandle, 'Fixture Data','Type',TypeString);

SetRField(SymbolHandle, 'Fixture Data','Wattage',WattageString);

end;

run(Test);

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...