×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Dimension text location while rerouting command5

 Forum Search FAQs Links MVPs

## Dimension text location while rerouting command

(OP)
Hi,
When I reroute the dimension, many times dimension text is moved to opposite direction. I want that in same side before rerouting. But, now, I am moving that text manually. Is there any setting available to keep the dimension text remain at same place while using rerouting command. Kindly give any idea.
Suresh

### RE: Dimension text location while rerouting command

When rerouting a dimension you need to use the same picking order that was used to create the original dimension if you want to keep the text in the same place. As far as I know this is just trial and error/lucky guess - if the first try is wrong undo and repick in the opposite oder. I hope this helps.

### RE: Dimension text location while rerouting command

(OP)
Hi Derby,
Thanks for the reply.
As you mentioned, i checked the extension line 1 & 2 of the dimensions in properties. Then, i found that if we select the same extension line 1 first when rerouting, then the dimension text location is not get changed. If select reverse, it is going to the other side. But, for simple rerouting, if we go to properties, find extension line one by hide that in properties then roroute means time consuming.
If we able to find out the extension line 1 or 2 without going to properties, it will be fine for us to easily reroute.
If it is not possible, then as you said trial and error is the solution.
Kindly suggest a shortcut if it possible to find extension line number.

Suresh

### RE: Dimension text location while rerouting command

3
you can run a script that would hide ext line 2, then put it back when you done:

(you could start the script with a shortcut to be more friendly)

Thanks to http://www.tek-tips.com/faqs.cfm?fid=4699 I learn non modal dialog box

#### CODE --> CATVBA

Private Declare Function MessageBox _
Lib "User32" Alias "MessageBoxA" _
(ByVal hWnd As Long, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal wType As Long) _
As Long

Sub CATMain()
Dim initState As New Scripting.dictionary ' need MS Scripting runtime
Dim odoc As DrawingDocument
Set odoc = CATIA.ActiveDocument

Dim oview As DrawingView
Set oview = odoc.Sheets.ActiveSheet.Views.ActiveView

Dim dimens As DrawingDimension
Dim extline As DrawingDimExtLine

For Each dimens In oview.Dimensions
Set extline = dimens.GetDimExtLine
extline.SetVisibility 2, 0
Next

MessageBox &H0, "Click OK when dim routing is done", "Hiding second ext line", vbSystemModal

For Each dimens In oview.Dimensions
Set extline = dimens.GetDimExtLine
extline.SetVisibility 2, initState.Item(dimens.Name)
Next
set initState = Nothing
End Sub 

Eric N.
indocti discant et ament meminisse periti

### RE: Dimension text location while rerouting command

Star for you Eric. Is even more interesting when you combine vbSystemModal with minimize/maximize vba form. Is like a toolbar always there , you don't need CAA to create your own dropdown menu or multitab toolbar, collecting what ever you need from different workbenches

Regards
Fernando

### RE: Dimension text location while rerouting command

you can add it to the next version of your script center...

Eric N.
indocti discant et ament meminisse periti

### RE: Dimension text location while rerouting command

(OP)
Hi itsmyjob & ferdo,
I am a beginner in macro and its usage in Catia. I tried by copy the script in note pad, save it as text file and change the extension as CATVbs. When I tried to run that macro it showing the error message as shown in the attachment. Kindly give me an idea how to resolve it.

Also, if it is possible, please change the macro that instead of hiding the extension line 2, change the color of extension line 1 as green. By this way, I can click this macro and change all the extension line 1 as green color and once complete all editing work, click the same macro to change all to black color and save the drawing.

Suresh

### RE: Dimension text location while rerouting command

#### Quote (suresh070379)

Also, if it is possible, how can i change the macro that instead of hiding the extension line 2, change the color of extension line 1 as green. By this way, I can click this macro and change all the extension line 1 as green color and once complete all editing work, click the same macro to change all to black color and save the drawing.

#### Quote (suresh070379)

I am a beginner in macro and its usage in Catia.

Everyone has to start someday. If you want to know more about what is available in CATIA scripting I would suggest you spend some time reading the V5Automation.chm in your catia install directory.

You can learn about CATIA objects, methods and properties ... then search for DrawingDimExtLine which is the object for the extension line of a dimension. Check which methods or properties are available for this object.

For changing color google example, you should find many... or look again in scripts from V5Automation.chm

If you have a problem with your script, please post your code and inform us on the error message.

Eric N.
indocti discant et ament meminisse periti

### RE: Dimension text location while rerouting command

2
(OP)
Hi,
I got an idea by search method as below.
Search > all dimensions > set over run of all extension line 1 as zero > reroute all the required dimensions > at last repeat the same and set default.
By this way, I can easily find out the first extension line and select the same while rerouting and keep the dimensions in same place.
Suresh

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

#### Resources

White Paper: Rapid Manufacturing with FDM
The automotive industry is increasingly turning to additive manufacturing, and fused deposition modeling (FDM) specifically, as a reliable alternative to traditional metal-cutting methods, like milling, turning and boring. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!