ordinate Dimensions using sketch points

ordinate Dimensions using sketch points

Mario-Villada
Advocate Advocate
605 Views
1 Reply
Message 1 of 2

ordinate Dimensions using sketch points

Mario-Villada
Advocate
Advocate

Hi All,

I  am trying to add Ordinate dimensions  using scketch points, my code spits out an "Unspecified error" when I try to use one sketch point as a geometry intent to create origin indicator method in the drawing view. here is some code:

{code}

 

Dim oDV as DrawingView
Dim oSheet asSheet
Dim oGIntent asGeometryIntent
Dim Sktch asDrawingSketch
Dim sktP assketchPoint
Dim oPt asPoint2d
Dim TG as transientGeometry

 

  oPt := oDV.ModelToDrawingViewSpace(Inv.TransientGeometry.CreatePoint(0,0,0));

  Sktch := oDV.Sketches.Add;
  Sktch.Edit;
  sktP:= Sktch.SketchPoints.Add(oPt,false);
  oPt := oDV.ModelToDrawingViewSpace(Inv.TransientGeometry.CreatePoint(100,52.5,0));
  sktP:= Sktch.SketchPoints.Add(oPt,false);
  sktch.ExitEdit;

  oGIntent := oSheet.CreateGeometryIntent(Sktch.SketchPoints.item[1],emptyparam);
  oDV.CreateOriginIndicator(oGIntent); // Here is when the error happens

 

{code}

 

I also tried to set

sktP.ConnectionPoint:=true; 
sktP.InsertionPoint :=true;

 

but no luck.

 

I also noticed that the points created are not visible after sktch.ExitEdit, but  i don't see a way to make them visible.

 

Any Ideas?

 

Thanks,

 

Mario.

0 Likes
606 Views
1 Reply
Reply (1)
Message 2 of 2

Mario-Villada
Advocate
Advocate

Nevermind, I found a workoround by addng lines to the sketch and using the start point as geometry to crate the geometry intent.

 

Although I think there is a contradiction in the Inventor programming help file, since it says that  Valid input objects for the geometry parameter in Sheet.CreateGeometryIntent Method are sketch entities from a sheet sketch. and as far as I know a sketch point IS as sketch entity from a sheet sketch.

 

0 Likes