Get Coordinates of workpoint using ilogic

Get Coordinates of workpoint using ilogic

Ktelang
Collaborator Collaborator
5,090 Views
2 Replies
Message 1 of 3

Get Coordinates of workpoint using ilogic

Ktelang
Collaborator
Collaborator

Hello Everybody,

 

How to get coordinates of a workpoint using iLogic.

can anyone help me with this

 

Thanks

------------------------------------------------------------------------------
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
-----------------------------------------------------------------------------
0 Likes
Accepted solutions (1)
5,091 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi  Ktelang,

 

Here's a quick example for working with workpoints.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument

Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim oWorkPoint As WorkPoint

'create a workpoint
oWorkPoint = oDoc.ComponentDefinition.WorkPoints.AddFixed(oTG.CreatePoint(1.123, 1.124, 1.125))
'display the new workpoint's coordinates
MessageBox.Show(oWorkPoint.Point.X  &", "&  oWorkPoint.Point.Y &", "&  oWorkPoint.Point.Z, "iLogic1")

'identify the first point in the workpoints collection aka the origin point
oWP = oDoc.ComponentDefinition.WorkPoints(1)
'display the first workpoint's coordinates
MessageBox.Show(oWP.Point.X  &", "&  oWP.Point.Y &", "&  oWP.Point.Z, "iLogic2")

'display a named workpoint's coordinates
oWP1 = oDoc.ComponentDefinition.WorkPoints("Work Point1")
'display the first workpoint's coordinates
MessageBox.Show(oWP1.Point.X  &", "&  oWP1.Point.Y &", "&  oWP1.Point.Z, "iLogic3")

EESignature

0 Likes
Message 3 of 3

Ktelang
Collaborator
Collaborator

Thanks Curtis

It helped

 

 

------------------------------------------------------------------------------
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
-----------------------------------------------------------------------------
0 Likes