Custom Device fields

Many people need to add extra fields to device records either to store metadata or to integrate with their existing business systems. Here’s how to do that and how to display this information on the drawing if you need to.

Open the Vectorworks Plug-in Manager

Open_the_Vectorworks_Plug-in_Manager.png

Select Device and click Edit Definition

Select_Device_and_click_Edit_Definition.png

In your case you will find Device under the Third-party Plug-ins tab. Here it’s in Custom Plug-ins because I’m the developer 🙂

Go to the parameters tab and click the New… button

Go_to_the_parameters_tab_and_click_the_New..._button.png

Set up your new parameter

Set_up_your_new_parameter.png
  1. Give it a name. I recommend keeping this to a single word without spaces or special characters.
  2. You can also optionally set a more friendly display name that will be shown in the Object Info Palette
  3. Choose the parameter type. We support Text, Radio Buttons, and Pop-up. Pop-up is particularly useful where you have a specific chioce of valid input.
  4. Set the default value – can be empty if you like.

Exit all dialogs with OK and close the Plug-in Manager.

Now let’s see what we’ve done.

Enter a device group and select the tag

Enter_a_device_group_and_select_the_tag.png

Now every device will have a field called ‘IPaddress’. This gets displayed is all related dialogs, So if you click on a device with the Edit tool you’ll see the new field in the dialog. If you do Make Device List, ‘IPaddress’ appears as one of your choices.

So far so good, but how do we see this on the drawing?

Visualising user device fields

What we would like to see is this. But how do we get there?

Locate the ‘dev_rec’ record format in the Resource Browser

Locate_the__dev_rec__record_format_in_the_Resource_Browse.png

Right-click and select Edit…

Add a new field called ‘IPaddress’ to dev_rec

Add_a_new_field_called__IPaddress__to_dev_rec.png

Click the New… button to open the Field dialog.

Give the field exactly the same name as your Device parameter – in this case IPaddress

The fields type should be Text – we don’t support numeric fields. If you need numbers type them in as text.

Exit dialogs with OK.

Locate the symbol ‘dev_label_generic’ in the Resource Browser

Locate_the_symbol__dev_label_generic__in_the_Resource_Bro.png

This is the symbol used to create device label graphics and text. It’s located in the ‘system_symbols’ folder of your document.

Right click on it and select Edit 2D Component.

Select All to see what’s there

Select_All_to_see_what_s_there.png

The reason for this is that some items don’t have default text so you can’t see them if they aren’t selected. In the next step you’ll add your own text item for the IP address and you don’t want it to be over the rack location for example.

Create a text item in the symbol

Create_a_text_item_in_the_symbol.png

Change fonts, size, colours etc. to match your particular style.

Go to the Modify / Link Text to Record menu command

Go_to_the_Modify__Link_Text_to_Record_menu_command.png

With the text item you just created selected – do the Modify / Link Text to Record menu command. In the dialog select the Format ‘dev_rec’ and the Field ‘IPaddress’.

Click OK.

Text is now linked to the value of ‘IPaddress’

Text_is_now_linked_to_the_value_of__IPaddress_.png

It disappears because the default value of this for the symbol definition is empty. Not to worry 🙂

Click Exit Symbol to commit the changes.

Now use the Edit tool to modify one of our devices

Now_use_the_Edit_tool_to_modify_one_of_our_devices.png

The IPaddress field is displayed and I’ve just changed the value. Click OK and…

Ta-dah !!!

Ta-dah____.png

There it is.

One last cool thing

One_last_cool_thing.png

I said that user fields appear in the dialogs. Check this out…

Make a device list.

Update Device data direct from the list

Update_Device_data_direct_from_the_list.png

Type you data into the spreadsheet – it updates the drawing right away.

Now that’s useful 🙂

Leave a Reply