Jump to content
Developer Wiki and Function Reference Links ×

Edit a symbol in vectorscript


Recommended Posts

Hi folks,

my big question is: is it possible to edit a symbol in vectorscript?

I have a symbol in a wall, that symbol is a custom door, so in the interface I can go to the edit mode, and edit the door params by double clicking.

I would like to modify some of those parameters (door jamb, width and so on) in vectorscript but Im not able to get the door object inside the symbol.

Ive been searching in the forums long time but Im stuck here. Any clue?

thanks in advance.

Jose

Link to comment

I don't have a VW at the moment, but this should work:

to get the symbol in the wall:

symH:=FIn3D(WallH);

to get the door inside the symbol:

symN:=GetSymName(symH);

doorH:=FInSymDef(GetObject(symN));

Maybe this one will work as well:

doorH:=FInSymDef(symH);

When you have more then 1 object in your wall, you need to loop trough them all with:

symH:=NextObj(symH);

UNTIL symH=NIL;

Best is also to check the type of the object (should be 15 for symbol (or 16 for symbol definition)):

objType:=GetTypeN(symH);

And the same thing when you have more then one object in your symbol:

doorH:=NextObj(doorH);

UNTIL doorH=NIL;

Link to comment

Yes, that made it!

Dankjewel Maarten :)

This is the resulting code:

symH := FIn3D(wallH);		{ first symbol in the WALL }
while (symH <> nil) do begin
  ObjType := GetTypeN(symH);

  if (ObjType = 15) then begin	{ it's a Symbol }
     symN:=GetSymName(symH);
     objH:=FInSymDef(GetObject(symN));

     {Process window/door/whatever objH}

     end;
  symH  := nextobj(symH );

end;	{ while }

Edited by Jose Maria
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...