Jump to content
michaelk

Customizing OIP

Recommended Posts

When creating a custom tool is there a way to show calculated values in the OIP?  In the same way the rectangle OIP show ratio, perimeter, and area.

 

 

Share this post


Link to post

Ha.  4 hours ago I thought I understood it.  🙂

 

Is there a sample .vso that uses one of each kind of parameter?  

Share this post


Link to post

SetRField always requires a string. If you have a dimension or coordinate field, you can set the value as a number using the base document units (inches, mm, etc.), and the field will take care of formatting correctly.

 

Concat() is a good quick and dirty way to format a value as a string. Very useful with things like booleans.

 

To make a field read only, the easiest method is to preface the field name with a single underscore. (Make sure to include the underscore in the SetRField argument).

Share this post


Link to post

Thanks, Gentlemen.  Got the first part working.  I can now display calculated values in the OIP.

 

I would like to make these values available in the attached database. 

 

SetRField won't (at least for me) set anything but a string.  If I use the object definition to create a dimension field, for example, how can I write to that field?

 

Do I create new fields in the record inside the object script and write to that?

 

Share this post


Link to post

That wasn't clear at all.

 

Let's say I have calculated numeric and dimension values that I'm writing to static text parameters.

 

Is there away to also write them as real numbers, integers, dimensions to fields in the same record as the object?  So their values can be used in worksheets without having to use the Value() function?

Share this post


Link to post

SetRField only handles strings. It can be used to write into a field formatted as a number, but you will need to make sure the string passed converts to a valid valuator the format you are writing to.

 

So in an Integer or number field you would have to pass something that VW recognizes as number.  2, 7.123, 0.0008, 17.3", 256.456 mm.

 

Think about it this way, if you can type it into a field and have it respond properly, then that is the string you need to pass to SetRField.

 

GetRField will also return the String equivalent of the number, so if you can you are better off using the Record.Field combination so that you don't have to do any conversion and get the value directly from numeric fields.

 

Share this post


Link to post

Just to add, even internally, VW stores field data as strings (at some point you're writing data to the file). You just have to make sure that writing data uses a string that VW can validly convert to the stored data type. When you're not dealing with SetRField, VW does this behind the scenes.

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.

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.


 

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