bjod
Mechanical
- Feb 7, 2003
- 37
Hi everyone!
This is my first post here at the autocadforum.
I'm a CATIA V5 user and I'm trying to write a macro which saves the CATIA drawings as dwg's, opens them up and gives them the right scale.The macro will be run from CATIA VBA.
I'm basically trying to select everything in the drawing in AutoCAD, and then scaling it with 0,0,0 as basepoint.
(the drawings come out in wrong scale after conversion)
When I run this in a macro from within AutoCAD, it runs very fast, but when I run it from CATIA, it creeps along very slowly.
Our converted CATIA drawings often have about 15000 objects, so I was wondering wheter there was is way to scale all objects simultaneously instead of one by one.
here's the code I'm using after opening up the drawing:
**************************
Dim objecttoselect3 As AcadSelectionSet
Set objecttoselect3 = oDrawing.SelectionSets.Add("SSET1"
Dim corner1(0 To 2) As Double
corner1(0) = 0: corner1(1) = 0: corner1(2) = 0
objecttoselect3.Select acSelectionSetAll
objecttoselect3.Highlight True
AcadApplication.Update
Dim indrawing As Double
indrawing = objecttoselect3.Count
i = 0
Do
objecttoselect3.Item(i).ScaleEntity corner1, 20
i = i + 1
Loop Until i = indrawing
******************
I hope anybody have some suggestions to make my macro run faster, and thanks for taking the time.
-Bjod
This is my first post here at the autocadforum.
I'm a CATIA V5 user and I'm trying to write a macro which saves the CATIA drawings as dwg's, opens them up and gives them the right scale.The macro will be run from CATIA VBA.
I'm basically trying to select everything in the drawing in AutoCAD, and then scaling it with 0,0,0 as basepoint.
(the drawings come out in wrong scale after conversion)
When I run this in a macro from within AutoCAD, it runs very fast, but when I run it from CATIA, it creeps along very slowly.
Our converted CATIA drawings often have about 15000 objects, so I was wondering wheter there was is way to scale all objects simultaneously instead of one by one.
here's the code I'm using after opening up the drawing:
**************************
Dim objecttoselect3 As AcadSelectionSet
Set objecttoselect3 = oDrawing.SelectionSets.Add("SSET1"
Dim corner1(0 To 2) As Double
corner1(0) = 0: corner1(1) = 0: corner1(2) = 0
objecttoselect3.Select acSelectionSetAll
objecttoselect3.Highlight True
AcadApplication.Update
Dim indrawing As Double
indrawing = objecttoselect3.Count
i = 0
Do
objecttoselect3.Item(i).ScaleEntity corner1, 20
i = i + 1
Loop Until i = indrawing
******************
I hope anybody have some suggestions to make my macro run faster, and thanks for taking the time.
-Bjod