Jump to content

How to create a legend?


Recommended Posts

I'm sure I'm missing something basic here but how do I create a legend for a sheet? Basically I've got a number of landscape areas with different hatches representing different hardscapes and some linetypes representing various boundaries. I attach an example from a drawing created manually in AutoCAD. I'm looking to create something similar to the stuff I've marked with a red border (unfortunately it's all in Swedish but I hope the purpose is understandable). How do I do this best?

 

210610637_Skrmavbild2021-09-27kl_09_37_16.thumb.png.c821747b1c528560ce76636cf023f25a.png

Edited by Anders Blomberg
Link to comment

I'd be interested to hear what other people say but I have a similar legend for electrical symbols that I created manually + saved as a 2D symbol. I have it in my Favorites + when I need it insert it on a sheet layer. If there are any items on the legend which aren't relevant to the drawing in question I just edit the symbol to remove them. If I need to change its size I scale it in the OIP. Not very sophisticated but it doesn't need to be.

 

In your case, if your labels are actually tagging objects in the drawing, then you may be able to do something clever using Data Tags + Worksheets...?

  • Like 2
Link to comment
15 hours ago, E|FA said:

If you're willing to wait a while & keep your fingers crossed for a good implementation, this is in the public roadmap:  https://www.vectorworks.net/en-US/public-roadmap

 

You can submit comments if you click on the roadmap items.

 

Fingers are totally crossed. Are the roadmap features deployed with service packs at all or only with yearly major updates? There are a bunch of them that I would be looking forward to a lot!

Link to comment
Guest Shengxi Wu

Hi all, thanks for bringing up the discussion. We'd be very interested in learning how people create a graphic legend for their project, so that we could make informative design decision. If you have your own unique way of creating a graphic legend, or any complaint about the current workflow, please share it with us in this thread.

 

I am quoting some responses from above, all following questions and discussions are open to everyone.

 

For the graphical symbol part of your legend, are they usually 2D line works (i.e., lines, arcs and 2D polygons)? Will a symbol in a legend looks 100% identical with the actual one you placed on a drawing? If no, how are they different from each other? What additional information are included in a graphical symbol part of a legend, but not shown on the actual one placed on a drawing (and vice versa)?

 

Do you think it would be helpful if graphical symbols of your legend are smart objects (e.g., fill/pattern, 2D/3D symbol, plug-in objects) instead of 2D line works? Should the graphic legend live inside a viewport (e.g., as 2D Symbol/line works in viewport annotation), or an independent object that can be associated with a viewport/sheet layer?

 

On 9/27/2021 at 3:43 AM, Anders Blomberg said:

I'm sure I'm missing something basic here but how do I create a legend for a sheet?

 

By saying you want to "...create a legend for a sheet", do you mean you want to associate a legend with a specific viewport on a sheet layer(i.e., only includes symbols/objects that appeared in a specific viewport), or ALL viewports on a sheet layer?

 

On 9/27/2021 at 7:18 AM, Tom W. said:

I'd be interested to hear what other people say but I have a similar legend for electrical symbols that I created manually + saved as a 2D symbol. I have it in my Favorites + when I need it insert it on a sheet layer. If there are any items on the legend which aren't relevant to the drawing in question I just edit the symbol to remove them. If I need to change its size I scale it in the OIP. Not very sophisticated but it doesn't need to be.

Is there anything that you don't like with your current legend workflow? Will you anticipate the ability of being able to update a legend (i.e., automatically add/remove a legend line) based on its associated viewport/sheet layer?

Link to comment
14 hours ago, Shengxi Wu said:

For the graphical symbol part of your legend, are they usually 2D line works (i.e., lines, arcs and 2D polygons)?

Somewhat related to this is the existing Window Schedule worksheets with images which I guess is quite close to a legend. I found it quite annoying that the images were just that, images, so one could not interact with the linework, take/show dimensions etc. One of the examples I saw in VW presentations about this future possible feature was window schedules, and in my opinion the tool will need to generate linework so that dimensions can be related to it like the image below. 

 

This is especially important as installations are more complex where the window frame is partially covered by the outer finish as shown.

1993863725_Screenshot2021-09-29at11_05_49.thumb.png.e0d89cda77b6f63d782b8d0b7b381d58.png

 

14 hours ago, Shengxi Wu said:

Will you anticipate the ability of being able to update a legend (i.e., automatically add/remove a legend line) based on its associated viewport/sheet layer?

Yes, for the example of electrical symbols on a plan it would be great to link the legend to that viewport so that it reported only the symbols in that viewport. Like the OP, I also have a electrical symbol key/legend saved as a symbol that I drop onto sheet layers. I've seen others say they go in and edit the legend symbol to reflect what is shown in the viewport - I am too lazy to do this - but also I think it is just an opportunity for errors, plus it adds a lot of time checking the drawings by having to go through each and every item.

 

For electrical symbol legends, it would be very helpful if the number of items could be reported also, as well as data such as manufacturer/model so that the legend becomes a schedule as well.

 

Link to comment
Guest Shengxi Wu
6 hours ago, _James said:

This is especially important as installations are more complex where the window frame is partially covered by the outer finish as shown.

1993863725_Screenshot2021-09-29at11_05_49.thumb.png.e0d89cda77b6f63d782b8d0b7b381d58.png

 

 

 

Thanks James for the feedback!

 

One additional question to confirm for the Window Installation Legend you shown here. I realize in the plan/section view that not only the window, but also the host wall of the window is shown in the legend graphic. I am wondering if it is important or necessary to include and display host wall in such legend (I am guessing the answer is yes since the dimension of Finished Opening needs to be labeled on the host wall🙂).

Link to comment
21 hours ago, Shengxi Wu said:

Is there anything that you don't like with your current legend workflow?

Probably not to be honest. I tried creating my electrical symbols legend using a worksheet instead + whilst this has the advantage of only displaying symbols relevant to the file, I don't have the same control over how the symbol is represented in the legend or the order they are listed (you can reorder spreadsheet rows but not database rows - correct?).

 

(As an aside, I thought I could use the criteria 'Location is within (viewport name)' to report solely on the electrical symbols in a specific viewport but this didn't work...?)

 

6 hours ago, _James said:

For electrical symbol legends, it would be very helpful if the number of items could be reported also, as well as data such as manufacturer/model so that the legend becomes a schedule as well.

This of course you can do very easily with a worksheet (I have a key on the sheet showing what the different symbols are plus a separate schedule listing the numbers of the items. This works for me because some things I want on the key + not on the schedule + vice versa).

 

So for me at least the issue is perhaps more to do with worksheets + increasing the control/options you have when seeking to display images + other graphics. I know there's been a fair bit of discussion on this on the Forum

Link to comment
  • Vectorworks, Inc Employee
8 minutes ago, jeff prince said:

Why do I get the feeling that theses legends are going to become overly complicated and not serve the spirit of what a legend is supposed to be?

 

Good point!  This is exactly why these questions are being asked.  Legends can vary widely for different types of information in different projects and different trades.  What we want to do is explore what different users want.  We want legends to be as flexible as possible but they cannot be everything to everybody and every project and trade.  I believe Shengxi's goal behind his questions is to come up with a list of essential minimum requirements that must be met to make the feature useable, another list of requirements that are common in most legends but not absolutely necessary, then a list of features that would be nice to have but are the least needed.  This will allow us to create the most flexible feature set without unnecessarily complicating the UI.

Link to comment

For my purposes, I'd like to be able to choose any graphic element (symbol, line type, hatch, material, etc) in the file, and add text to describe it, and place on any sheet (including multiple instances). Often my graphic keys are on the title page and are used for the full drawing set.  At other times, the key is on a single sheet with multiple drawings (SLVPs), or for a single drawing (SLVP).  I would be satisfied generating this manually, but automating this to find elements that actually appear in the drawing, sheet, or VP, and adding "best guess" text would be nice to have.

 

Ability to reorder the list and manually add info would be very important.

  • Like 2
Link to comment

I'd like to be able to make a legend using all the symbols in a particular symbol folder in the resource manager - wether or not those symbol are currently inserted into the drawing.  

 

In the same way you can now enter tags for symbols, perhaps two "fields".  One for the name of the symbol to appear in the key and one for a description.  

 

<Symbol Image>   |    Receptacle    |    20A-125V (NEMA 5-20R) GFCI DUPLEX OUTLET, 4mA-6mA TRIP, CLASS A, SHUTTERED CONTACTS, AUTOMATIC CIRCUIT TEST, ON / OFF LIGHT & TRIP INDICATOR, IMPACT RESISTANT NYLON. IVORY.

 

If that could go into a worksheet, that would be great!  If there's any way the symbol image could be vectors when possible and not a bitmap, that would be great, too.

  • Like 2
Link to comment
39 minutes ago, michaelk said:

I'd like to be able to make a legend using all the symbols in a particular symbol folder in the resource manager - wether or not those symbol are currently inserted into the drawing.  

 

Try this.  Not a schedule but this script works for me.  The symbols are placed close together but after the legend is created I move the last group down and use the distribute command.  File attached.

 

"""
This script inserts all of the symbols in the current drawing resource manager into the drawing with
the symbol name.  Symbol and text are in an individual group. 
Use the distribute command to space them evenly after creation. 

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

David Hamer, 2021 revision 09/29/2021
"""

ecnt = reset = xP = yP = vcnt = ocnt =scnt= mcnt= pcnt  = 0

def DoIt(h5):
	global xP,yP
	SymName = vs.GetSDName(h5)
	vs.BeginGroup()
	vs.Symbol(vs.GetSDName(h5),xP,yP,0)
	vs.TextOrigin(xP+50,yP)
	vs.TextSize(9)
	vs.TextFont('Arial')
	vs.CreateText(SymName)
	vs.DoMenuTextByName('UPPER CASE',0)
	vs.EndGroup()
	yP -= 25
	

hSEL = []
h1 =vs.FSymDef()
while h1 != []:
	hSEL.append(h1)
	if vs.GetTypeN(h1) == 92:
		h2 = vs.FInGroup(h1)
		while h2 != []:
			hSEL.append(h2)
			h2 = vs.NextObj(h2)
	h1 = vs.NextObj(h1)

for h in hSEL:
	if vs.GetTypeN(h) == 16:
		DoIt(h)

 

Legend Creator.vwx

Edited by The Hamma
  • Like 1
Link to comment

Updated to center symbols and added tag script. 

 

I updated the script to center the symbols and center the text on the symbol.  Also I added a second script to use a record rather than the symbol name.  You will have to assign the "Legend Record" to the symbol in the resource manager and give it a name in "Legend Text" Field.  

Record will be created on first run if it does not exist. Sample file attached.

 

image.png.5cbec24c6ca2c90e290640ea0f04c4bd.png

 

 

"Create Symbol Legend" script  -  uses Symbol Names 

"""
This script inserts all of the symbols in the current drawing resource manager into the drawing with
the symbol name.  Symbol and text are in an individual group. 
Use the distribute command to space them evenly after creation. 

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

David Hamer, 2021 revision 09/30/2021
"""

xP = yP  = 0

def DoIt(h5):
	global xP,yP
	vs.BeginGroup()
	(p1,p2) = vs.GetBBox(h5)
	p1x=p1[0]
	p1y=p1[1]
	p2x=p2[0]
	p2y=p2[1]
	p3x = p2x-p1x
	p3y = p1y-p2y
	vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0)
	vs.TextOrigin(xP+40,yP)
	vs.TextSize(9)
	vs.TextVerticalAlign(3)
	vs.TextFont('Arial')
	vs.CreateText(vs.GetSDName(h5))
	vs.DoMenuTextByName('UPPER CASE',0)
	vs.EndGroup()
	yP -= 25
	

hSEL = []
h1 =vs.FSymDef()
while h1 != []:
	hSEL.append(h1)
	if vs.GetTypeN(h1) == 92:
		h2 = vs.FInGroup(h1)
		while h2 != []:
			hSEL.append(h2)
			h2 = vs.NextObj(h2)
	h1 = vs.NextObj(h1)

for h in hSEL:
	if vs.GetTypeN(h) == 16:
		DoIt(h)

 

 

"Create Symbol Legend (Record)" script  -  uses "Legend Record" Record

"""
This script inserts all of the symbols in the current drawing resource manager into the drawing with
the text in Record "Legend Record" and field "Legend Text" if assigned to a symbol. 
It ignores symbols with the record but no text in the "Legend Text" Field. 
Symbol and text are in an individual group. 
Use the distribute command to space them evenly after creation. 

First run will create "Legend Record" if it does not exist.

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

David Hamer, 2021 revision 09/29/2021
"""
xP = yP = 0

def DoIt(h5):
	global xP,yP
	vs.BeginGroup()
	(p1,p2) = vs.GetBBox(h5)
	p1x=p1[0]
	p1y=p1[1]
	p2x=p2[0]
	p2y=p2[1]
	p3x = p2x-p1x
	p3y = p1y-p2y
	vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0)
	vs.TextOrigin(xP+40,yP)
	vs.TextSize(9)
	vs.TextVerticalAlign(3)
	vs.TextFont('Arial')
	vs.CreateText(vs.GetRField(h5,'Legend Record','Legend Text'))
	vs.DoMenuTextByName('UPPER CASE',0)
	vs.EndGroup()
	yP -= 25

if vs.GetObject('Legend Record') == ():  # Creates "Status and Phase" record if not present
	vs.NewField('Legend Record', 'Legend Text', '', 4, 0)

hSEL = []
h1 =vs.FSymDef()
while h1 != []:
	hSEL.append(h1)
	if vs.GetTypeN(h1) == 92:
		h2 = vs.FInGroup(h1)
		while h2 != []:
			hSEL.append(h2)
			h2 = vs.NextObj(h2)
	h1 = vs.NextObj(h1)

for h in hSEL:
	if vs.GetTypeN(h) == 16:
		if vs.GetRField(h,'Legend Record','Legend Text') != '':
			DoIt(h)

 

 

"Create Symbol Legend (Tag)" script  -  uses "Tag"

"""
This script inserts all of the symbols in the current drawing resource manager into the drawing with
the text in Record "Legend Record" and field "Legend Text" if assigned to a symbol. 
It ignores symbols with the record but no text in the "Legend Text" Field. 
Symbol and text are in an individual group. 
Use the distribute command to space them evenly after creation. 

First run will create "Legend Record" if it does not exist.

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

David Hamer, 2021 revision 09/29/2021
"""
xP = yP = 0

def DoIt(h5):
	global xP,yP
	vs.BeginGroup()
	(p1,p2) = vs.GetBBox(h5)
	p1x=p1[0]
	p1y=p1[1]
	p2x=p2[0]
	p2y=p2[1]
	p3x = p2x-p1x
	p3y = p1y-p2y
	vs.Symbol(vs.GetSDName(h5),xP+((p3x/2)-p2x),yP+((p3y/2)-p1y),0)
	vs.TextOrigin(xP+40,yP)
	vs.TextSize(9)
	vs.TextVerticalAlign(3)
	vs.TextFont('Arial')
	tagarray = vs.GetResourceTags(h)
	vs.CreateText(tagarray[0])
	vs.DoMenuTextByName('UPPER CASE',0)
	vs.EndGroup()
	yP -= 25

hSEL = []
h1 =vs.FSymDef()
while h1 != []:
	hSEL.append(h1)
	if vs.GetTypeN(h1) == 92:
		h2 = vs.FInGroup(h1)
		while h2 != []:
			hSEL.append(h2)
			h2 = vs.NextObj(h2)
	h1 = vs.NextObj(h1)

for h in hSEL:
	if vs.GetTypeN(h) == 16:
		tagarray = vs.GetResourceTags(h)
		if tagarray:
			DoIt(h)

 

 

 

Legend Creator.vwx

Edited by The Hamma
  • Like 4
Link to comment

Thanks @The Hamma for figuring out the tags!

 

Just for fun, here's a first pass at the idea.

 

It will make a key using all the symbols in the specified folder with either the symbol name, any field from an attached record, or the first two tags in the symbol definition.

 

The handles will control the placement of the title and the width of the columns.

 

The tool will create Text Styles for all the various parts.  You can edit those to make it work better for you.

 

This is halfway to a useful tool.  If anyone has any feedback I might keep working on it 🙂.  If not, it was a fun afternoon.

Keyy Beta.vso Key Tool Test 9 30 21 v2021.vwx Key Tool Test 9 30 21.vwx

  • Like 1
  • Love 1
Link to comment

Updated 2022-03-08 ... Added companion script to move selected symbols to a new symbol folder to use as a filter for the Symbol Legend Script. 

 

Updated 2021-10-08.... re-download script if you download it prior.

 

Thanks to @michaelk for figuring out how to make Data tags appear in my schedule and for helping me with the textstyle. 

 

Here is my go at the plugin version of a symbol legend.  Unlike @michaelk my script does not provide headers for the columns so if you need that try his version. 

This legend was created using "Tags" as a description, "Test Folder" as the source resource folder and since the symbols are inserted alphabetically I added a number in front of the name of each symbol in the drawing to determine the order that they were inserted in.  

If the filter fields are populated tool will use the filter. If the checkboxes are checked the tool will exclude items filtered. 

 

If text style "SymLegendTS" doesn't exist it will be created.  Modify this style to change the text style of the labels. 

 

PIO can be exploded and manually adjusted.  each symbol and description are in individual groups.  

I you try it out and find any issues please let me know. 

 

image.png.26b21a97bf3f2713811716d0e3043178.png

 

 

 

 

Symbol Legend.vso Move Symbol to Folder.vsm

Edited by The Hamma
  • Like 2
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...