prolynx
Mechanical
- Sep 9, 2005
- 29
Hello !
This seems pretty simple, I want in a drawing to select at the same time many lines to be hidden to get "cleaner" views.
At the moment, I can only do it by "multi-selecting" the lines by drawing a box with the mouse where the lines are completly in. In most cases, this is not good, because lots of extra lines will also be included.
So I was looking at the possibility to use the "free hand selection trap". Well, the "tools palette" where this is located is not showing up when clicking the "hide" button, so I tried to create a macro to emulate it.
So I came up with the following:
Language="VBSCRIPT"
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
Dim Selection As Selection
Set Selection = drawingDocument1.Selection
Dim Status,InputObjectType(0)
InputObjectType(0)="AnyObject"
Status=Selection.SelectElement3(InputObjectType,"Select lines",true,CATMultiSelTriggWhenSelPerf,false)
if (Status = "Cancel") then Exit Sub
For PointIndex = 1 to Selection.Count2
Set visPropertySet1 = Selection.VisProperties
visPropertySet1.SetShow 1
next
Selection.Clear
End Sub
The tools palette comes up as expected, and I can draw the freehand line, but the problem is that the whole view (or views) gets hidden, not only the lines that are "intersected" with the freehand line I draw. This works if I select a line before running the macro, but again, this is not good as in this case, the macro is useless because I can't run the tools palette before.
I also tried to change the type to Line2D, but this only works with line I added on the drawing, not the lines coming from the 3D.
I'm running out of ideas how to solve that, so I'm now asking here if anyone have any idea. Maybe it's much easier that I thought, but at the moment, I really can't get it.
Oh, I don't know if it matters, but we are using Catia V5 R20
Thanks in advance !
This seems pretty simple, I want in a drawing to select at the same time many lines to be hidden to get "cleaner" views.
At the moment, I can only do it by "multi-selecting" the lines by drawing a box with the mouse where the lines are completly in. In most cases, this is not good, because lots of extra lines will also be included.
So I was looking at the possibility to use the "free hand selection trap". Well, the "tools palette" where this is located is not showing up when clicking the "hide" button, so I tried to create a macro to emulate it.
So I came up with the following:
Language="VBSCRIPT"
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
Dim Selection As Selection
Set Selection = drawingDocument1.Selection
Dim Status,InputObjectType(0)
InputObjectType(0)="AnyObject"
Status=Selection.SelectElement3(InputObjectType,"Select lines",true,CATMultiSelTriggWhenSelPerf,false)
if (Status = "Cancel") then Exit Sub
For PointIndex = 1 to Selection.Count2
Set visPropertySet1 = Selection.VisProperties
visPropertySet1.SetShow 1
next
Selection.Clear
End Sub
The tools palette comes up as expected, and I can draw the freehand line, but the problem is that the whole view (or views) gets hidden, not only the lines that are "intersected" with the freehand line I draw. This works if I select a line before running the macro, but again, this is not good as in this case, the macro is useless because I can't run the tools palette before.
I also tried to change the type to Line2D, but this only works with line I added on the drawing, not the lines coming from the 3D.
I'm running out of ideas how to solve that, so I'm now asking here if anyone have any idea. Maybe it's much easier that I thought, but at the moment, I really can't get it.
Oh, I don't know if it matters, but we are using Catia V5 R20
Thanks in advance !