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
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
RE: Dimension text location while rerouting command
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
(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 Subindocti discant et ament meminisse periti
RE: Dimension text location while rerouting command
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Dimension text location while rerouting command
indocti discant et ament meminisse periti
RE: Dimension text location while rerouting command
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Dimension text location while rerouting command
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
I didn't check but in Eric's post is written CODE->CATVBA , in your error is written catvbs... Can you see the difference? Is not the same language/extension... even if users are saying generally macro they are different....check with Google please.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Dimension text location while rerouting command
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...
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.
indocti discant et ament meminisse periti
RE: Dimension text location while rerouting command
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