Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom User Defined Properties

2 REPLIES 2
Reply
Message 1 of 3
ericbUU8RW
189 Views, 2 Replies

Custom User Defined Properties

I am trying to output some Custom User Defined Properties. I have defined them like so

 

WORKORDERNUMBER: {
    title      : "DE WO NUMBER",
    description: "Work Order Number",
    //group: 0,
    type       : "string",
    value      : "stuff",
    //scope      : "post"
  },

 

but when I try to output them like this

 

writeComment("WORK ORDER NO.: " + properties.WORKORDERNUMBER);

 

I get

 

(WORK ORDER NO.: OBJECT OBJECT           )

 

 I have changed other post with User Defined Properties but the were structured differently. The have a "user-defined properties" block and a "user-defined property definitions". This post only has the "user-defined properties".
 
Any suggestions?
 
 
2 REPLIES 2
Message 2 of 3
serge.quiblier
in reply to: ericbUU8RW

Hello @ericbUU8RW .

 

In order to interrogate the value of the property, you must use the getProperty function.

https://cam.autodesk.com/posts/reference/classPostProcessor.html#a8f6be90781835876e83f3f9c3a2a9f2e

 

Regards.

 


______________________________________________________________

If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!



Serge.Q
Technical Consultant
cam.autodesk.com
Message 3 of 3

Hello, @ericbUU8RW .

For new post properties format you need to use special function `getProperty` to get its value instead of specification. So, your example should look like this:

 

 

writeComment("WORK ORDER NO.: " + getProperty(properties.WORKORDERNUMBER));

 

See documentation: PostProcessor Class Reference (autodesk.com)

 


Viacheslav Shapilov
Developer Technical Services
Autodesk Developer Network


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report