Jump to content
Developer Wiki and Function Reference Links Read more... ×
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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.

×