I am using NX 10 and Mechatronics Concept Designer. Is there a way to make an object (like a button) move down when it is clicked with mouse ,and then send a signal to an OPC output?
Another question about the Display changer function, is it possible to make a color change in any other way than collision sensor ?
In other words, I want the color of an object (indicator light) to be changed when an OPC signal (input) is active.
1. The Button: In MCD you are able to apply forced by grabbing and pulling the rigid bodies during the simulation, you can use this to simulate a button or a switch (it will not work by just clicking though, you have to hold and pull abit).
2. The Display Changer in NX10: Unfortunate the Displaychanger only works with Collision Bodies right now. But If you have a LED, a lamp or similar, you can create your own "Universal Display Changer" with the runtime behaviour feature and abit C# code. See the example (the C# code is included in the example aswell).
I have made an example for both the button and the LED which is triggered by the button through a signaladapter (see attachment and video).
I hope this will help...
Hey, thank you for the video,
How do I define the Search for the component structure of the assembly ? (in row 37 of the example) If I have no split body in my part ?
I used the Split Body because my LED was one single solid body.
I would recommend using the journal for examples like this, that way you get real C# Code of your actions in NX (e.g. selecting components and switching color in NX).
But before you use the Journal I would highly recommend switching the journal language in customer defaults or preferences from VB (Visual Basic) to C#, you can do this here:
After that you can activate the developer Tab in your Ribbon (right click and activate "Developer")
Then you can record your actions in c# and implement them in your runtime behaviour in MCD and dont forget to save your model before running custom code .
I just downloaded and tested it again, but it works in my environment.
Is the Runtime Behaviour connected to the led signal?
What NX Version do you use? I tested it with NX 10.0.1.4 with MP3 installed.
Yes , I have connected the signal. My NX version is 10.0.0.24
Is there something I have to change in the C code ? And when I apply this code in another project, what do I have to change from these lines?
You have to Change the component to your specific component in the project (e.g. lamp).
I have made an Video that shows the process with the same code but another assembly, you can find it in the attachment.
In this next example I change the color of the whole part and not only the solid body thats why I dont need to search for the split body feature and just add the whole component to the objects
Thank you, that cleared something... But I did everything as you said in the last post, but the color still does not change...
Could there be something wrong with my NX version, or Assembly..
Are you able to change color of the components by using the "Edit Object Display" (ctrl + J) in NX?
What rendering mode do you use?
Have you tried different rendering methods?