Jump to content

Vectorscript - Keeping Text Horizontal in Symbols


Recommended Posts

I was wondering, first, if it is possible to write vectorscript that would keep all text within a symbol horizontal, regardless of how the actual symbol is placed, and second, if this would be difficult script to write. I know virtually nothing about vectorscript, but now might finally be the time to wade in.

Thanks in advance.

Link to comment

It is certainly possible to create an object in VS that can be rotated and will keep all of the text horizontal, but it will probably be a Plug-in object (PIO) rather than a symbol.

If you need this for many different types of things, you could probably use a symbols geometry to serve as the basis of the PIO, but there is only one symbol definition. If you rotate an instance of the symbol, all parts rotate. If you edit the definition so the text in one instance is horizontal, then it will change the settings in all the other parts.

What kind of "symbol" are you talking about and how many different "symbol" geometries are there?

Link to comment

I see. In my case it is actually text within a symbol, which is within another symbol. Since we use window pios nested within symbols, we haven't been entirely happy with the current id tag (it doesn't seem to update when data for the window symbol changes, you have to place them manually for each window, etc). Hence, we've resorted to applying a custom data record to a custom symbol we use to id the window symbols, and we place those identifiers with the window pio inside of a symbol. Therefore, a symbol within a symbol.

This quickly populates the drawing with the appropriate tags for the appropriate window symbols, but the text becomes vertical when the window symbol is placed in a wall running page North to page South.

Here's an example:


If there's another way to accomplish what we are trying to do, I would certainly be open to it. However, I've spent the past few days trying to sort out a quick and easy way to do windows with ids, create and schedule, while maintaining a good dynamic between the schedule, id and window so if data changes in one place it is reflected everywhere else at the same time. This seems like best solution thus far.

Thanks for the input.

Link to comment

If you can convert your id tags to a PIO, then you should be able to continue working pretty much like you are, but it will be harder to modify the graphics.

I think the real answer lies in another thread.

If we came up with a way for you to edit the record attached to a symbol definition and then apply that data to every (or selected) instantances of the symbol, then you would not need to use your custom record and could use the built in id tags.

Probably a much easier script to write. I was going to point you to the other thread, but it looks like you started that one also.

Link to comment

I assume, however, that placing a pio within a symbol will fix the text at the orientation it is given? One of the benefits of placing the tag for the window within the same symbol that contains the window pio is that it saves a bunch of time tagging all of the windows in the drawing (there are a lot in the current drawing I am working on). I believe the ID pios have the same text problem when placed in symbols.

The biggest problem I had with the ID symbol pio is that it didn't seem to automatically update its label when I updated the data record for the window symbol it was identifying. That was the biggest show-stopper for me. Did I set up the custom ID symbol incorrectly? I believe I added all of the pertinent data in the Tag Schema in the ID symbols file, directing the id to use a certain field of the symbol it is identifying through the 'TagSpec' and 'TagText' fields in the data record, but regardless of what I tried, the ID label would initially pick up the correct ID that I had specified for the window, but would not update that ID if I changed the data. That kind of defeats the purpose for me.

Link to comment

The PIO would have to be written to take into account the rotation of both itself and the "parent" object (the symbol). This should be possible. I don't know if the standard PIOs handle this correctly or not.

I think you may have been using the ID object wrong as it changes here for me with no problem

When I insert a window (not a symbol, but a window object), and the select the ID tool and click where I want the ID to be places and then click on the window, the ID is linked to the window and automatically updates when you make a change in the OIP for the window.

I have not used the ID tool to link it to a custom record, so I can't comment on that part.

Link to comment

The standard PIOs don't rotate the text appropriately when nested in symbols. However, I did notice that the "Adjust Flipped Text" setting in the vectorworks preferences does affect all of the text in the document, but it does not place all of the text horizontally. It appears to place it horizontally and in one direction vertically. If only I could get access to that script to modify it! That might do the trick.

I think i figured out my problem with the id symbol not auto-updated. I specified the "TagSpec" field in the Tag Schema Record as the field I wanted it to point to as opposed to leaving it named "ID". I think that might solve the problem.

Link to comment

This is my first attempt to rotate the text within the many symbol instances of the same definition so that the text appears horizontal universally, but I realize that if the vectorscript works at all, it is trying to rotate the text within the original symbol and in that symbol it is probably aligned properly anyway.

additionally, in my drawing the id symbol for the window is a symbol within a symbol, and I realize that I did not address that in the vectorscript as well.

Any feedback would be very helpful. Thanks!

PROCEDURE RotateSymbolText;


textHdl : Handle;

objHdl : Handle;

textIsMirrored :Boolean;

textOriginX, textOriginY, textAng, objAng :Real;


objHdl := FActLayer;

while (objHdl <> nil) do


if (GetType(objHdl)=15) then


textHdl := FInSymDef (objHdl);

if (GetType(textHdl)=10) then


GetTextOrientation(textHdl, textOriginX, textOriginY, textAng, textIsMirrored);

objAng:= GetSymRot(objHdl);

HRotate(textHdl, textOriginX, textOriginY, -objAng);


textHdl := NextObj(textHdl);


objHdl := NextObj(objHdl);





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.

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