niedzviedz
Mechanical
- Apr 1, 2012
- 307
Hello,
I'm writing some journal to move some part objects to specifics layers. For example planes on 60 sketches on 70 and rest of curves on 80. Right now I have some problems with curves if they are in sketch, because my code move them all to layer 80.
How can I exclude curves which are parts of sketch? I tried:
but an error occurred with info that "system.nullreferenceexception object reference not set to an instance of an object".
With best regards
Michael
I'm writing some journal to move some part objects to specifics layers. For example planes on 60 sketches on 70 and rest of curves on 80. Right now I have some problems with curves if they are in sketch, because my code move them all to layer 80.
Code:
for each curveObj as Curve in WorkPart.Curves
curveObj.Layer = CurveLayer
curveObj.RedisplayObject
next
For Each tempSketch As Sketch In workPart.Sketches
tempSketch.layer = SketchLayer
tempSketch.RedisplayObject
next
Code:
curveObj.OwningComponent.tostring = "sketch"
but an error occurred with info that "system.nullreferenceexception object reference not set to an instance of an object".
With best regards
Michael