Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting 2D point from active sketch in inventor?

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
mucip
1770 Views, 10 Replies

Selecting 2D point from active sketch in inventor?

Hi,

I'm using Inventor 2013 and VB-Express. I have form to do something. When I press the button on this form, I want to select two point from the active sketch and draw rectangle between these points. Every time user need to select by mouse.

 

How can I make user to select 2Dpoint intereactively from the active sketch?...

 

Regards,

Mucip:)

 

 

10 REPLIES 10
Message 2 of 11
adam.nagy
in reply to: mucip

Hi,

 

Have a look at this post. The mouse events part might work inside the Sketch environment as well:

http://adndevblog.typepad.com/manufacturing/2013/02/pick-a-point.html

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 11
mucip
in reply to: adam.nagy

Hi Adam,

Thanks for your kind interest. Infact, I have seen this blog in Google search but I couldn't understand how can I do this in VB-Express API?... Especially the mouse event?!...

 

Is there guidence sample for VB-Express API to pick point?...

 

Regards,

Mucip:)

Message 4 of 11
adam.nagy
in reply to: mucip

Hi Mucip,

 

Just to clarify, the Inventor API is not specific to VB Express, it's the same everywhere.
Event handling is not specific to VB Express either, but to the programming language: in your case VB / VB.NET

 

There is a VB.NET sample in the SDK that should help you get started with implementing what you want:

"C:\Users\Public\Documents\Autodesk\Inventor 2015\SDK\DeveloperTools\Samples\VB.NET\Standalone Applications\Inventor\UserInteraction"

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 5 of 11
mucip
in reply to: adam.nagy

Hi Adam,

it would be perfect if I have Inventor 2015 but I use still 2013 unfortunately... 😞

 

Is there any other alternative in case of check this code which you explain to me?...

 

Regards,

Mucip:)

Message 6 of 11
mucip
in reply to: mucip

Hi Adam,

I saw many post in this forums that the VBA code doesn't work with API.

 

http://forums.autodesk.com/t5/inventor-customization/addin-doevents-doesn-t-work/m-p/4329286/highlig...

http://forums.autodesk.com/t5/inventor-customization/doevents-and-vb-net-selection/m-p/2006589/highl...

http://forums.autodesk.com/t5/inventor-customization/mouse-event-does-not-work-in-2011-2009-no-probl...

 

I will try to find API version of this code...

 

Maybe you may publish the API version of the code which you target me above...

 

Regards,

Mucip:)

Message 7 of 11
mucip
in reply to: mucip

Hi,

I found below code from İnventor Programing help section but not work?!...

 

Dim Nokta As Inventor.Point2d

'Dim Nokta As object

Nokta = Form1.inv_App.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select the point...")

MsgBox("Seçilen: " & Nokta.X)

 

 

When I set is as object then it works... How can I convert object to point?...

 

Regards,

Mucip:)

Message 8 of 11
ekinsb
in reply to: mucip

The type of object being returned is a SketchPoint not a Point2D object.  This should work.

 

Dim Nokta As Inventor.SketchPoint

Nokta = Form1.inv_App.CommandManager.Pick(SelectionFilterE​num.kSketchPointFilter, "Select the point...")

 

If you need the position of the sketch point you can use its Geometry property which returns a Point2D object.

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 9 of 11
mucip
in reply to: ekinsb

Dear Brian,

This the code which I need exactly... Thanks... 😉

 

Regards,

Mucip:)

Message 10 of 11
kagum93
in reply to: mucip

Hi, sorry for digging up the topic.
Do you perhaps remember how you wrote this code? Is the snippet suggested by @ekinsby the whole code or just part of the larger code? Was it written in ilogic editor or in VBA? Thanks in advance for your reply.

Message 11 of 11
mucip
in reply to: kagum93

Dear kagum94,

It's been 10 years and I don't remember sharp sorry.

But I was using Visual Basic and Inventor API.

Regards,

Mucip:)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report