- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks,
Here in the folowing example, I'm using the command manager to pick a surface (pipe) to add a component.
I'm creating the component, adding to assembly, placing the constraints around the pipe, etc.
The last constraint that I didn't add is in the axis of the pipe. The component can move left & right according to the axis. As for now it is landing randomly along the axis. Whould there be somehow a way to get the 3D point where I clicked using the commandManager.Pick method ?
Thank you & kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
..Dug in the documentation & found out what I was looking for.
Here is the code I ended up with :
Private Class Testing
Private Selecting As Boolean
Sub Main()
Dim i As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
i.InteractionDisabled = False
Dim selectEvents As Inventor.SelectEvents = i.SelectEvents()
AddHandler selectEvents.OnSelect, AddressOf oSelectEvents_OnSelect
i.Start
Selecting = True
While Selecting = True
ThisApplication.UserInterfaceManager.DoEvents()
End While
i.Stop
End Sub
Private Sub oSelectEvents_OnSelect(ByVal JustSelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
MsgBox("X :" & Round(ModelPosition.X, 2) & " Y :" &Round(ModelPosition.Y, 2) & " Z :" & Round(ModelPosition.Z, 2))
Selecting = False
End Sub
End Class
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"