Raise window

Raise window

GeorgK
Advisor Advisor
526 Views
5 Replies
Message 1 of 6

Raise window

GeorgK
Advisor
Advisor

Hello together,

 

i would like to set automatically a lot of holes. I have a sketch with a lot of points. How could I get all the points which are in a raised window

(by pressing the left mouse button and drawing a window while keeping the mousebutton pressed)?

 

Thank you

 

Georg

0 Likes
Accepted solutions (1)
527 Views
5 Replies
Replies (5)
Message 2 of 6

AlexFielder
Advisor
Advisor

You can do this with the CommandManager.Pick method and the SelectionFilterEnum.kSketchPointFilter filter for it:

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-60D6E12D-1471-4AD9-9748-67D7EE63333D

 

🙂

0 Likes
Message 3 of 6

GeorgK
Advisor
Advisor

Hello Alex,

 

do you have a sample for me?

 

Thank you Georg

0 Likes
Message 4 of 6

Owner2229
Advisor
Advisor
Accepted solution

I guess Alex meant something like this:

 

Dim oComps As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
While True
	Dim oComp As Object = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kSketchPointFilter, "Select some points.")
	' If nothing gets selected we're done here
	If IsNothing(oComp) Then Exit While
	oComps.Add(oComp)
End While
If oComps.Count = 0 Then Exit Sub

'List through the points For Each oSP As SketchPoint In oComps 'Do something with the point Next
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 5 of 6

AlexFielder
Advisor
Advisor

That's the ticket @Owner2229! 🙂

 

@GeorgK did you click the link I posted? There are a whole bunch of samples on that page:

 

2017-04-07 09_29_57-Inventor 2018 Help_ CommandManager.Pick Method.png

 

Check out my other thread to set up searching the API documentation from within Google Chrome:

 

https://forums.autodesk.com/t5/inventor-customization/searching-the-online-api-help-without-having-t...

 

🙂

0 Likes
Message 6 of 6

GeorgK
Advisor
Advisor

Thank you very much for your help. I added the search function to my browser.

0 Likes