Jump to content
Developer Wiki and Function Reference Links ×

Customizing OIP


Recommended Posts

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

Link to comment

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?

 

Link to comment

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?

Link to comment

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.

 

Link to comment

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.

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