I am working in product, trying to create a hybridshapespline (in product 1) using another product (product 4).but i am facing issue ,the curve is connecting to it won axis system instead of connecting to indented reference product point.when i replace the the reference point with the part it is working fine, but if i give reference to another product is not working.
Sub AddPointtocurve()
Dim mycat As productDocument
Set mycat = catia.ActiveDocument
Dim myharness
Set myharness = mycat.product.products.item(1).ReferenceProduct.Parent.part
Dim myhybrid As HybridBodies
Set myhybrid = myharness.HybridBodies
Dim myext
Set myext = myhybrid.item(1).HybridShapes
Dim myeleitem
Set myeleitem = myhybrid.item(2).HybridShapes.item(1)
Dim mypointpart As part
Set mypointpart = mycat.product.products.item(4).ReferenceProduct.Parent.part
Dim mypoint As Point
Set mypoint = mypointpart.HybridBodies.item(1).HybridShapes.item(1)
Set ReferenceOnPoint = mypointpart.CreateReferenceFromObject(mypoint)
myeleitem.AddPointWithConstraintExplicit ReferenceOnPoint, Nothing, -1, 1, Nothing, 0
i have tried with different option as bellow nothing work for me.
myeleitem.SetPointBefore (2), ReferenceOnPoint
myeleitem.SetPointConstraintExplicit 2, Nothing, -1, 1, Nothing, 0
myeleitem.SetPointBefore (2), ReferenceOnPoint
i am not sure , it is possible to add point on curve using another product reference.
any suggestions please.
charan tej is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1