Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dimension text location while rerouting command 5

Status
Not open for further replies.

suresh070379

Mechanical
Nov 21, 2014
62
0
0
IN
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
 
Replies continue below

Recommended for you

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.
 
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
 
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 I learn non modal dialog box

Code:
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
 
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
 
 http://files.engineering.com/getfile.aspx?folder=5d1806c6-3a96-4b5b-bb07-eb1363ab8a30&file=Macro_error.jpg
suresh070379 said:
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...

suresh070379 said:
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
 
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
 
Status
Not open for further replies.
Back
Top