Jump to content
Pat Stanford

Copy Dimension Text into Attached Record/Field

Recommended Posts

In response to a post on the General Discussion, I put this script together. It will copy the data in the Dimension String of a Dimension object into a user attached Record named "DimFomat" and Field named "MyField". Change the Const values to whatever you need.

The thread that started this is https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=209786#Post209786

Procedure DimToRecordField;

{Written in response to a request on the General Discussion Forum}
{© Pat Stanford, April 2, 2015,  Released into the Public Domain. No Rights Reserved}
{Change the DimRecord and TheField constants to match your record and field names}
{Script store the data from the DimText into a user attached record and field}

Const	DimRecord='DimFormat';

Function HasRecord(H1:Handle; RecordName:String):Boolean;

Var		N1:Integer;

	For N1:= 1 to NumRecords(H1) do
			If GetName(GetRecord(H1, N1))=DimRecord then HasRecord:=True;
	{You could add code here to SetRecord if you wanted to add the record}
	{ to items that don't have it already attached}

Procedure Execute(H1:Handle);

	If HasRecord(H1,DimRecord) then SetRField(H1,DimRecord,TheField,GetDimText(H1));

ForEachObject(Execute, (((T=DIMENSION) & (SEL=TRUE))));


Share this post

Link to post

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.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...