×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*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.

Students Click Here

Jobs

Dimension text location while rerouting command
5

Dimension text location while rerouting command

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
        initState.Add dimens.Name, extline.GetVisibility(2)
        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

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

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.

Thanks for your interest in scripting. We can help you, but I will not work for free. Please read your onlince documentation about difference in CATScript, MS VBScript, VBA...

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.

Reply To This Thread

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

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


Resources

eBook - Mastering Tolerances for Machined Parts
When making CNC machined parts, mastering tolerances can be challenging. Are general tolerances good enough? When does it make sense to call out for tighter tolerances? Do you need a better understanding of fits, datums, or GD&T? Learn about these topics and more in Xometry's new e-book. Download Now
eBook – How to Choose the Correct Corrosion Testing Method
When designing a metal component, engineers have to consider how susceptible certain alloys are to corrosion in the final product’s operating environment. In a recent study by NACE (National Association of Corrosion Engineers), it was estimated that the direct and indirect costs of corrosion in the United States is approximately 6.2% of the GDP. In 2016, that cost exceeded $1 trillion dollars for the first time. 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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close