[Closed] .NET – SimpleObject2
By the way: at the moment the WPF window workaround (which helps A LOT if you like do do more cool stuff like buttons for example, which I also did not get done using the “regular” way) leads to another problem. If I update the mesh, which works really fast, it does not update inside the viewport. Only when I close the window (when EndEditParams is called).
I do have controls inside the WPF Window that update the mesh of the SimpleObject2. The boundingbox gizmo changes while changing the control (slider) but the mesh itself only updates when the window is hidden. I use all things like validity and what else is needed (and worked without using SimpleObject2) but it doesn’t change.
Edit: the way I did it before was
- Generate an INode
- Manipulate its IMesh
- Change the IMesh again using the controller(s) inside the WPF Window
This worked but I wanted my own kind of object, not just a simple node. That’s why I tried to switch over to SimpleObject2. After finally having a solution for changing the mesh [using the cast (this as SimpleObject2).Mesh] I stumpled upon all the other problems so far. Your hint about loadAssembly brought me a BIG step forward! Didn’t think of differences using this method.
HA! I did it!
One has to call NotifyDependents with the RefMessage “Change” after changing the parameters inside the WPF Window. And don’t forget about
Interface.RedrawViews(0, RedrawFlags.Interactive, null);
to force the view to redraw. Otherwise there will be a delay until the mesh shows up.