Hi Friends,
I have a VBA code that calculate the footprint of a system by multiplying the largest horizontal dimension on the base view and that on the right view. The code loop through all the drawing dimension object and for each one it checks whether it's orientation (By checking DimensionTypeEnum). If horizontal, it will record and find the largest value for base view and right view respectively(By checking the x of dimension origin).
This code runs well for many drawings but not all because on some drawings, some dimensions are kAlignedDimension Type for some reasons(We have thousands of drawings made by different people).
My questions are:
1. Can I do anything else/extra to check the orientation of the drawing dimensions?
2. I know drawing dimension object is under sheet object directly instead of the view object. Is there anyway I can know whether a dimension is on base view or right view, other than checking the coordinates of the dimension origin point?
I am not that knowledgeable in Inventor API. Thank you guys in advance.
Solved! Go to Solution.
Solved by yan.gauthier. Go to Solution.
Hi,
Maybe you could use the DimensionLine value ?
If typeof odrawingdim.DimenisonLine is LineSegment2D then
if odrawingdim.DimensionLine.Direction.X = 1 then
'Dimension is Horizontal
else if odrawingdim.DimensionLine.Direction.Y = 1 then
'Dimension is vertical
end if
end if
cheers
That works(after adding direction.x=-1 as well), thanks so much buddy!
Do you by any chance know the answer to my second question? How to check if a view is a base view or a projected view?
if Not DrawingView.ParentView is nothing then
'Means this view is a projected view
end if
Can't find what you're looking for? Ask the community or share your knowledge.