How to create points in a component in SpaceClaim?
Ansys Staff
Member, Employee Posts: 24
✭✭✭✭
When I create points in SpaceClaim with the following command :
point = Point.Create(X[i],Y[i],Z[i])
result = DesignCurve.Create(GetRootPart(),CurveSegment.Create(PointCurve.Create(point)),False).SetColor(None, Color.FromArgb(transparency, redColor,greenColor,blueColor))
This created points in curves folder under root part. How can I create these points directly within a specific component?
For example :
Create component named “bob”
Create points under “bob”
Tagged:
4
Answers
-
you can try to move the point in the component after creation
rootPart = GetRootPart() component = rootPart.Components[0] # A component already exists point = Point.Create(1, 1, 1) pointCurve = PointCurve.Create(point) trimmedCurve = CurveSegment.Create(pointCurve) designCurve = DesignCurve.Create(rootPart, trimmedCurve, True) ComponentHelper.MoveBodiesToComponent(Selection.Create(designCurve), Selection.Create(component))
or
ClearAll() component = ComponentHelper.CreateAtRoot("ComponentBob") ComponentHelper.SetActive(Selection.Create(component)) activePart = GetActivePart() point = Point.Create(1, 1, 1) pointCurve = PointCurve.Create(point) trimmedCurve = CurveSegment.Create(pointCurve) designCurve = DesignCurve.Create(activePart, trimmedCurve, True)
0 -
You can set the component active then create the point. The point will be in the component.
ClearAll() component = ComponentHelper.CreateAtRoot("ComponentBob") ComponentHelper.SetActive(Selection.Create(component)) point = Point.Create(1, 1, 1) result = SketchPoint.Create(point)
or
ClearAll() component = ComponentHelper.CreateAtRoot("ComponentBob") ComponentHelper.SetActive(Selection.Create(component)) activePart = GetActivePart() point = Point.Create(1, 1, 1) pointCurve = PointCurve.Create(point) trimmedCurve = CurveSegment.Create(pointCurve) designCurve = DesignCurve.Create(activePart, trimmedCurve, True)
0