0

Hello i need to add my sweep inside grometrical set as a reference. I am working on a part document. I got 2 different parts to try my macro. Macro works one of them.

Set hybridShapeSweepExplicit1 = hybridShapes1.Item(kalansweep)
MsgBox hybridShapeSweepExplicit1.Name
Dim alanolcusu As Double
ReDim matris(3)
Dim reference10 As Reference
Set reference10 = part1.CreateReferenceFromObject(hybridShapeSweepExplicit1)

kalansweep variable is "SWEEP_2" i can get SWEEP_2 as hybridShapeSweepExplicit1 on one of my parts. But it doesn't work on other part. I checked kalansweep variable. It is still "SWEEP_2" but macro gets hybridShapeSweepExplicit1 as "Sweep.4" . I have no idea why it does work on one part but does't work on the other one.

Edit: kalansweep variable declared like:

 public kalansweep as string
  • 1
    How are you setting the value of this string? And are you sure it has the right value? Any public variable in CATIA VBA will keep it's value between executions of the macro. So you must make sure you initialize and set the value of all public variables every time you run. – C R Johnson Oct 14 '19 at 15:35
  • Try dimming the sweep as a generic Hybrid Shape. I.e.. ‘Dim hs as HybridShape’ – GisMofx Oct 14 '19 at 23:17

0 Answers0