Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Workpoint Coordinates from Positional Representation

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
mmeetsma
1113 Views, 13 Replies

Get Workpoint Coordinates from Positional Representation

I need to use positional representations in our drawings in order to get proper views. However, when I try to get a workpoint's coordinates from the view using the workpointLocation method it returns the coordinates of the workpoint before the positional representation was applied which isn't useful.

 

A workaround that I've used previously is to create a centre mark for the workpoint and then get the coordinates of the centre mark using the IvExtGetCentermarkPosition function. This returns the drawing sheet coordinates of the workpoint but in this case what I need are the view coordinates of the workpoint (for creating dimensions using the IvExtCreateLinearDim and IvExtCreateAngularDim functions).

 

Does anyone know if there is any way to get the correct view coordinates of a workpoint when using a positional representation in a drawing?

 

Matt

13 REPLIES 13
Message 2 of 14
Lesoux
in reply to: mmeetsma

Try this way:

 

Dim newPoint As Point = IvExtGetCentermarkPosition(yourCenterMark, "in")

Dim newPointX As Number = localX(newPoint , world? := False)

Dim newPointY As Number = localY(newPoint , world? := False)

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 3 of 14
mmeetsma
in reply to: Lesoux

No joy. This just returns the X and Y coordinates from the drawing sheet. I need the coordinates from the view.

 

Matt

Message 4 of 14
Lesoux
in reply to: mmeetsma

Ok. Try this way:

 

Method workpointLocation(workpointPart As Part, workpointName As String) As Point
  Dim modelPoint As Point = model.occurrenceWorkPoint(workpointPart, workpointName, :All)
  workpointLocation = iv_modelToView(self(), modelPoint)
End Method

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 5 of 14
mmeetsma
in reply to: Lesoux

That looks like the default workpointLocation method. It will only return the coordinates of the workpoint from the actual model instead of from the positional representation.

 

Way back in the Intent 1.2 days the workpointLocation method did work because the occurrenceWorkPoint method that it calls had an optional paramter to send it a positional representation to use. That optional parameter has been removed since then.

 

Matt

Message 6 of 14
Lesoux
in reply to: mmeetsma

Seems like everything works.

 

Capture2.PNG

 

Capture.PNG

 

 

Capture3.PNG

 

Capture5.PNG

 

Capture4.PNG

 

Capture6.PNG

 

Capture7.PNG

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 7 of 14
mmeetsma
in reply to: Lesoux

I get some very different results here. Are you using constraints or frame based positioning?

 

This is the drawing without the positional representation applied:

1.png

And this is the drawing with the positional representation applied:

2.png

Matt

 

Message 8 of 14
Lesoux
in reply to: mmeetsma

I used constraints in my previous example, because it easy to adjust on Intent level.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 9 of 14
mmeetsma
in reply to: Lesoux

I'm stuck on frame based with no easy path back to constraints at this point. Also, it looks like your example just moved a single part in the assembly while I need to rotate the entire assembly which may be affecting things differently.

Message 10 of 14
Lesoux
in reply to: mmeetsma

Why you don't use edges(vertices) to define dimensions? Why working points?

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 11 of 14
mmeetsma
in reply to: Lesoux

A lot of legacy design and code that I'm not interested in reworking to use entities instead of workpoints. Also, I don't think that IvLinearDimension and IvAngularDImension can properly handle all of the dimensions that we need.

 

Matt

Message 12 of 14
Lesoux
in reply to: mmeetsma

You can modify existing designs of linear and angular dimensions as you need using API. Just for example, see attached file.

 

Child rule example:

Child OverallLength As :IvLinearDimension
   part1 = yourPart
   entity1 = yourEntity
   textOrigin = funcpointLnrDimOffset(:Up, 1) ' (:Up, :Down, :Right, :Left)
   formattedText = "<DimensionValue/>"
   dimType = :horizontal ' (:vertical, :horizontal, :aligned, :arcLength, :symmetric, :diametric)
   centerText? = True
End Child

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 13 of 14
Lesoux
in reply to: mmeetsma

Sometimes to build something need destroy something Smiley Tongue

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 14 of 14
mmeetsma
in reply to: mmeetsma

Steps to work around this issue are:

 

1. Create a centre mark for the workpoint that you need to get coordinates from. Set visiblity to false so that it doesn't appear in the drawing.

2. Use the IvExtGetCentermarkPosition function to get the drawing sheet space coordinates of the workpoint via the centre mark created in step 1.

3. Use the DrawingView.SheetToDrawingViewSpace method in the Inventor API to transform the sheet space coordinates from step 2 to the correct drawing view space coordinates.

 

Matt

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

Post to forums  

Autodesk Design & Make Report