- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a linear general dimension using code that I have used before and I keep getting the error message below.
I have an assembly, TestSkidAssembly.iam, that has a bunch of workpoints I added that I use to attach dimensions to in a drawing, Test.dwg. All the files I am talking about are attached in a zip file below.
In the drawing I add the workpoints to the view, TopView, with the following code:
TopViewObject.SetIncludeStatus(W_ValueBottomDimensionPoint, True)
TopViewObject.SetIncludeStatus(W_ValueTopDimensionPoint, True)
These workpoints come across as Centermark objects in the view. I find the centermarks I need to create dimensions to. As you can see in the attached drawing, there is an ordinate dimension set that I created using this methodology using code. However, when I try to create the linear general dimension on the left side of the top view, I get the error above. The dimension you see was created manually by picking the two centermarks. Below is the code I use to try to create the same dimension.
GeometryIntentObj_1 = SheetObject.CreateGeometryIntent(W_ValueBottomCenterMark, IntentTypeEnum.kPoint2dIntent)
GeometryIntentObj_2 = SheetObject.CreateGeometryIntent(W_ValueTopCenterMark, IntentTypeEnum.kPoint2dIntent)
DimTextPoint = InventorApp.TransientGeometry.CreatePoint2d(W_ValueBottomCenterMark.Position.X - 0.5, (W_ValueBottomCenterMark.Position.Y + W_ValueTopCenterMark.Position.Y) / 2)
LinearDimObject = SheetObject.DrawingDimensions.GeneralDimensions.AddLinear(DimTextPoint, GeometryIntentObj_1, GeometryIntentObj_2, DimensionTypeEnum.kVerticalDimensionType, True)
Does anyone have any idea as to why I am getting an error? I have used this same code in a different Inventor addin and it worked fine there. What am I missing?
Thanks in advance,
Darren Haverstick
Paul Mueller Company
Solved! Go to Solution.