Jump to content

Guidance Appreciated on Record Formats, specifically how to attach to a piece of text


Recommended Posts

I'm learning Vectorworks and having fun working out how to make use of what it has to offer. 

 

I'm currently working on a materials take-off for a irrigation design and I can't help but think that I can speed up the process by adding record formats and extracting that into a worksheet that'll do the counting for me. I'd like to create pieces of abbreviated text that name a various parts or fittings, then place that text in the drawing near where that part or fitting would actually be in the layout of the design. This way, the list of parts needed to build the actual irrigation system could be visually cross referenced with the drawing of the design to see where the fittings are supposed go. All while saving a huge amount of time by being able to create a report of all the parts straight out of the drawing, rather than scrutinizing the drawing and writing it all down, all the while hoping I'm not skipping anything. 

 

Can I attach data (record format?) to a piece of text? If so, how do I go about doing it??

 

Thanks!

Edited by RBergman
Link to comment

Two possibilities.

 

1. Take a look at Data Tags.  You can make a tag that allows manual entry of text. You can format them to look however you want.

 

2. Custom Records and Link Text to Symbol.

Create a custom record with the field your need in the Resource Manager.

Make a Symbol. If you don't want any shape it could just be a locus point. Attach the Record to the Symbol in the Data pane of the OIP.

Put a piece of text near a placed instance of the symbol. The text is just a placeholder.

Select the Symbol and the Text. Modify:Link Text To Record. You will get a dialog box asking what Record/Field to use.

Repeat the above steps to add additional "fields"

You can now edit the field data in the Data pane of the OIP and the text displayed I the drawing will change.

 

Both of these are overly simplified, so ask again if you need more help.

Link to comment
  • 7 months later...
On 7/20/2022 at 8:17 AM, RBergman said:

I'm learning Vectorworks and having fun working out how to make use of what it has to offer. 

 

I'm currently working on a materials take-off for a irrigation design and I can't help but think that I can speed up the process by adding record formats and extracting that into a worksheet that'll do the counting for me. I'd like to create pieces of abbreviated text that name a various parts or fittings, then place that text in the drawing near where that part or fitting would actually be in the layout of the design. This way, the list of parts needed to build the actual irrigation system could be visually cross referenced with the drawing of the design to see where the fittings are supposed go. All while saving a huge amount of time by being able to create a report of all the parts straight out of the drawing, rather than scrutinizing the drawing and writing it all down, all the while hoping I'm not skipping anything. 

 

Can I attach data (record format?) to a piece of text? If so, how do I go about doing it??

 

Thanks!

Same problem here, over the years I made symbol libraries with all in all about 3000 symbols. Opening each symbol by right click and editing a default value of a record format manually takes about 20 clicks and about half a minute if you are quick with this. Editing 3000 Symbols will take at least 3 - 4 complete workdays if you concetrate on doing only this, and you will get crazy from this work....

Link to comment

You should be able to set up a worksheet so that you can see and edit all of the record values. It should take less time than editing each symbol manually. But I guess it will depend on how you know what values you want to change. If you have to look up all 3000 items to get the values, then yes it will take a long time.

 

  • Like 1
Link to comment

@Tom W. You are right, you are wrong, and we have been lying to you and ourselves for the last 4 or 5 years. 😉

 

You are correct that by default, a worksheet can not display resources, so the simple version of what I mentioned about won't work.

 

However a few versions ago (maybe 2018??) a new worksheet capability named DatabaseByScript was added. As the name implies, you write a script that will specify what items to show in each database subrow. They don't all have to be the same as they do when you are specifying criteria. It was originally added to allow reporting of subtotals above a database of plants.

 

Unfortunately, they don't let you do some of the best database functions like sort or summarize items. The script has to do that.

 

Here is a simple DatabaseByScript script that will return a subrow for each Symbol Definition with a record specified in the formula attached.

 

Copy the script below into a new blank script named "SymDefsWRecord"

 

Use it by right clicking on a row and choosing Edit Database Formula and entering a formula of:

 

=DatabaseByScript('SymDefsWRecord','Record Name Goes Here')

 

Put your record name in the formula as the second part of the formula.

 

For column A, enter a formula of =N  This will give you the Symbol Definition Name of the subrow.

For column B enter a formula of ='YourRecordName'.'YourFieldName' using your actual record and field names.

Add other columns as appropriate.

 

You will now have a database showing the symbol definition and the value of the specified field.  If you click into column B and the subrow and type in a new value and hit enter the typed value will be stored into the field for that symbol definition.

 

I believe the order will be the order the symbols were created in, but I am not certain. The script could be modified to sort the data, but would end up about twice as long.

 

HTH

 

 

 

Procedure SymDefsWRecord;
{©2023  Pat Stanford - pat@coviana.com}
{licensed under the Boost Software License 1.0}
{https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt}
{TL/DR Use as you want, attribution for source, No warranty}

{This script when used in a Vectorworks Worksheet DatabaseByScript Command}
{will return a worksheet database listing every Symbol Definition that}
{has the record that is defined in the first passed parameter attached}
{You can then use standard worksheet functions to display the Record}
{data.  A formula of =N in a column will give the symbol name.}

{To use, right click on a database row and choose Edit Database Formula.}
{In the formula bar make a formla OF}
{=DatabaseByScript('SymDefsWRecord','Record Name Goes Here')}

{Very lightly tested. Test for your use. Here be Dragons.}



Var	
	H1:	Handle;
	N1,N2:	Integer;
	ListID,ListLength,L3:LongInt;
	S1:	String;

Begin
	S1:=WSScript_GetPrmStr(0);
	ListID:=BuildResourceList(16,0,'',ListLength);
	For L3:=1 to ListLength do
		Begin
			H1:=GetResourceFromList(ListID,L3);
			N1:=NumRecords(H1);
			For N2:=1 to N1 do
				If GetName(GetRecord(H1,N2))=S1 Then
					Begin
						WSScript_AddHandle(H1);
					End;
		End;
End;

Run(SymDefsWRecord);

 

  • Like 2
  • Love 2
Link to comment
  • 1 month later...
On 3/16/2023 at 10:46 AM, adamscott said:

Same problem here, over the years I made symbol libraries with all in all about 3000 symbols. Opening each symbol by right click and editing a default value of a record format manually takes about 20 clicks and about half a minute if you are quick with this. Editing 3000 Symbols will take at least 3 - 4 complete workdays if you concetrate on doing only this, and you will get crazy from this work....

thanks a lot for help!

Link to comment
  • 9 months later...
On 2/20/2024 at 4:50 PM, Pat Stanford said:

Use just Database not DatabaseByScript.

 

Database takes critiera (like your record.field)

 

DatabaseByScript requires a relatively complicated script to specifically identify every object in the database in the correct order.

 

Hello, I've tried it and it's still empty. What I am trying to achieve is the same as the OP, link the Symbol definition records to the records of existing symbol instances. I've also followed the instructions by installing the script. But somehow nothing is showing up still. Do you have anymore tips?

 

 

Screenshot2024-02-23at15_46_14.thumb.png.20449a71a79c89278b1d3e57a8c67a89.png

Link to comment
On 2/20/2024 at 11:53 AM, KAKI said:

 

Hello, I am new to Vectorworks scripting. I've followed the instructions but the database still appears as blank. Can you help me see what's the issue? Thanks!

@Pat StanfordScreenshot2024-02-20at12_50_26.thumb.png.a7b57ae7e2699c654c4598d14f2374a8.png

 

Try using a comma (,) instead of a full stop (.) in the formula:

Screenshot2024-02-23at14_57_55.png.7347120f74cfe79d232d04dbc212465f.png

 

See how it's written in Pat's script:

Screenshot2024-02-23at14_58_34.png.6c4531580356436f6bcb492248a382cc.png

 

Depending on where you are in the world you might need to use a semi-colon (;) instead of the comma.

Link to comment

You are trying to use the Database criteria in the worksheet cell instead of in the database header.

 

Right click on the Row header (I usually start at Row 3 because it is easier to add extra lines above later when I figure out what titles I need).

Choose Database from the popup menu.

image.png.3e5959a1714e72ab15c3874ed748fcaf.png

 

This will open the Criteria Builder 

image.png.0f79cb896be6b5ab4e9d2b287dbd839f.png

 

When you click OK on the criteria builder, the Database function will be automatically created.

 

To edit later, right click on the database row header and choose Edit Criteria.

 

Or if you want to manually adjust the criteria choose the Edit Database Formula and the database formula will appear in the formula edit bar so you can change it.

 

Sorry that I didn't pick up on your putting the database in the wrong place on your first post.

  • Like 1
Link to comment
  • 1 month later...
58 minutes ago, SedlmeierGuenther said:

A semicola produces an error message (see screenshot) (a bracket is missing that is not missing).

 

I get the same message if I use a semi colon.

 

Have you tried testing it with a comma but using different object/record + see if that works? @Pat Stanford will know better but I think it is designed to only work on symbol definitions + so the issue may be that you're using Interiorcad records...

 

Link to comment

@SedlmeierGuenther

 

Your are trying to use the DATABANK (Database) function in a cell in the worksheet.

 

It does not work there.

 

DATABASE and DATABASEBYSCRIPT will ONLY work where set from the right click menu on the row header.  That is what converts the row into a database row.

 

Re-read the thread, especially my post from February 23. That should get you the information you need.

 

If that is not enough, then post a simplified example file here and we will try and make it work for you.

Link to comment

Thanks Pat for your answer,
I set the formula via the line heading by right-clicking.
Unfortunately, it is not.
Can you please take a look at this. I am attaching an example file in which the symbols (in the accessories manager) have a database reference to the “Interiorcad Sales Info” database.
It would be very important because I would have to change the database entries if there were a lot of symbols.
Greetings Günther Sedlmeier

Example database changing symbols.vwx

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