Jump to content

Apply Measuring Principal with Script


---
 Share

Recommended Posts

I'm having errors with applying a measuring principal to a feature. In this case the script generates the Surface Point Nominal and then goes to create the Measuring Principal. However the code generates an error "The element with the name already exists."

My initial thought is that I need to give the actual feature a unique name, but I don't see how to do that with the lines of code that are used to apply a measuring principle.

I don't have a ton of experience with Python Scripting in GOM, so I'm not familiar with all the GOM specific commands. I generated the code to create the feature and apply a measuring principle using the record function. Then taking the code generated I modified it to fit my needs.

Thanks!

GOM_SCRIPT_CODE.jpg

Link to comment
Share on other sites

I have been unable to come up with a desired solution. The closest I have come to solving my problem is to switch the block of code that generates the measurement principle to be "interactive". Doing this enables the software to generate the actual feature however it requires the user to click "OK" for each instance of the feature generation.

My preferred method is to have this be automatic. It still doesn't make sense to me why this isn't working...

I'm hoping someone has some insight on this. There isn't much literature available online.

GOM_SCRIPT_CODE.jpg

Link to comment
Share on other sites

I was able to answer my own question. The issue appears to be something to do with version 2017. I ran the script using Hotfix 2 and Hotfix 7, both failed. Running the script in version 2020 it works with no issues.

Link to comment
Share on other sites

 Share

×
×
  • Create New...