Get the line from an Horizontal/Vertical Contrain Invenor API

Get the line from an Horizontal/Vertical Contrain Invenor API

Anonymous
Not applicable
271 Views
0 Replies
Message 1 of 1

Get the line from an Horizontal/Vertical Contrain Invenor API

Anonymous
Not applicable

Dears,

I'm Annette, this my first post here in the Inventor discussion group. I hope you can help me.

I've created with the API, some lines and I've contrained them using the AddByTwoPoints function:

 

 

//The code is written in C#
PlanarSketch m_planarSketch;
m_planarSketch = (PlanarSketch)m_inventorApplication.ActiveEditObject;
SketchLine[] Lines = new SketchLine[12];
SketchPoint[] Points = new SketchPoint[12];
..............
.............

Lines[0] = m_planarSketch.SketchLines.AddByTwoPoints(Points[0], Points[1]);
Lines[1] = m_planarSketch.SketchLines.AddByTwoPoints(Lines[0].EndSketchPoint, Points[2]);


Now I search in m_planarSketch.GeometricConstraints[i] the Horizontal contrains and when I found one I would get the related line that is Horizontally contrained:
if (m_planarSketch.GeometricConstraints[i].Type.ToString() == "kHorizontalConstraintObject")
{
HorizontalConstraint Horiz_Object = (HorizontalConstraint)m_planarSketch.GeometricConstraints[i];
...........


From the Help a read that I need to work with the Entity of the HorizontalConstrain objec, so I defiend


SketchEntity Entity=Horiz_Object.Entity;

 


but from that point I'm totally lost....

Can someone help me? Also examples in VB will be fine for me!

Tanhk you very much!

Annette

0 Likes
272 Views
0 Replies
Replies (0)