Jump to content
Developer Wiki and Function Reference Links ×

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?

Link to comment
  • 1 month later...

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);

Link to comment

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.

×
×
  • Create New...