- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a "Duplicate Post" on here already but Ive run into an issue with some code.
oObj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select a drawing dimension.")
If oObj.DimensionType = DimensionTypeEnum.kHorizontalDimensionType Then
MsgBox("Horizontal", , "")
ElseIf oObj.DimensionType = DimensionTypeEnum.kVerticalDimensionType Then
MsgBox("Vertical", , "")
Else
MsgBox("Other", , "")
End IfI am trying to find if a dimension that contains text is either vertical or horizontal. The above code works on dimensions that do not have text but I need to find this value for values that have text.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What do you mean by "contains text" or "have text" ?
It seems to work even on dims that have additional text added to the number.
Can you provide an example file?
If this helped you, please click LIKE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I mean dimensions that have manuallally overridden text, i have attached an example document below.
I have double clicked on these dimensions and added the word "PANEL" to them, my program will eventually find the orientation of the two dimensions that have the word "PANEL" in them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The dimension type from the command manager pick function should not matter whether there is no text, additional text or over-ridden text.
The issue you'll get with the above workflow is it will depend on how you created your dimensions. To get a "horizontal" or "vertical" dimension type, it will require two "points" to be picked. If two "lines" are picked, it will be the "aligned" dimension type.
If this helped you, please click LIKE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to get a vertical or horiztonal result from an aligned dimension?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
You can see if this works for you. (Reference Link)
If TypeOf oObj.DimensionLine Is LineSegment2d Then
' MsgBox(oObj.DimensionLine.Direction.X)
' MsgBox(oObj.DimensionLine.Direction.Y)
If oObj.DimensionLine.Direction.X = 1 Then
MsgBox("Dimension is Horizontal.")
Else If oObj.DimensionLine.Direction.Y = -1 Then
MsgBox("Dimension is Vertical.")
End If
End If
If this helped you, please click LIKE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report