Jump to content

UUID listing in Records (and Worksheets)


Recommended Posts

I have seen previous posts for scripting the UUID into a record so that it can be viewed in a worksheet, but not examples of the actual scripts. Does anyone have such available to share?

 

The issue I have relates to tagging individual furniture symbols with a unique code for linking to external SQLite database for extracting finishes specifications via ODBC - materials and colours need to be applied to similar symbols but may vary for individual objects (8000 of them in current project). I know UUID's exist for all items, but I have no quick means of identifying these in records (and worksheets). I also know how to use the Data Manager to pipe the codes through to my own record, just not how to access them in the first instance.

 

The GetObjectUUID(h) function may work in a script but not in a worksheet as far as I can tell and I don't know how to script it.

Link to comment

GetObjectUUID(h) will work and you can use it in a worksheet.  I'll attach an example.

 

The tricky part is going to be putting it into a record field.  You can easily script something what will SetRField() with the UUID.  But what happens if you duplicate an object.  Both the original and the duplicate will have the same value in the UUID field of the record until you run the script to set the record field straight again.

 

I've never tried it but I'm assuming that ODBC can't read the UUID in any way that would be meaningful to SQLite.

 

 

 

UUID Example.vwx

  • Like 1
Link to comment

… and in rereading your post I realize I didn't answer your question at all :-).

 

This is how you get the UUID into a record:

 

 

PROCEDURE TEST;

	PROCEDURE WriteIt(h:Handle);

		BEGIN

			SetRField(h,'MyNewRec','UUID',GetObjectUUID(h));

		END;


BEGIN

	ForEachObject(WriteIt,((R IN ['MyNewRec'])));

END;

RUN(TEST);

 

I updated the file in the post above.  The worksheet now shows the UUID of objects and the UUID written to a record in some objects with the duplicate object problem.

Link to comment

Your response is exactly why I love this forum. Really helpful and a complete solution. Many thanks Michael. I will try out in earnest tomorrow.

 

I can use the UUID number to create a match key to an SQLite Database row to fetch additional data back into Vectorworks and populate additional record fields. I have 100 fields to populate for each symbol and over 8000 symbol instances so this is really the only option.

 

Cheers,

Marc

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