Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Can I use Mate Connector code in my FS to reference context objects?

I want to be able to use an MC to define a starting point on Context objects. It seems like the only script that can do this is Mate Connector itself. I copied the code into my FS and it works, but only if I don't change the name of the annotation for the query.
Anything other than definition.originQuery throws errors related to evMateConnectorCoordSystem
- is there another way to query locations using MC's implied points in a FS on Context objects?
- is there a way to be able to do this twice using the MC code? so I can define a start and an end?
0
Comments
I'm not certain, but it seems like the answer will be no. The fact that changing the const name to anything but "mateConnector" implies something being done outside of the scope of Featurescript. The plane feature is similar for changing the names displayed on planes in the 3D view. If you copy the code and only rename the function it doesn't do that anymore.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
The issue you are having with evMateConnectorCoordSystem is that you are inputting the "definition" as the map. Looking at the function this is pointing to a code that is out of the visible source code. What is most likely happening is that the definition is looking for very specific variables that you no longer have. If you update your variables to match or add code that equates the variables then it should in theory work.
But I am not sure why you would need to recreate the mate connector code. If the goal is create a mate connector you could use opMateConnector in combination with coordSystem to redefine the new origin and system.