Hello
I have created this userform to create point
Here is the macro code
Option Explicit
Private Sub OkBtn_Click()
Dim oDoc As Document
Set oDoc = CATIA.ActiveDocument
Dim partDoc As PartDocument
Set partDoc = CATIA.ActiveDocument
Dim part As part
Set part = CATIA.ActiveDocument.part
Dim HybBody As HybridBody
Set HybBody = part.HybridBodies.Add
part.InWorkObject = HybBody
Dim hybshpfact As HybridShapeFactory
Set hybshpfact = part.HybridShapeFactory
Dim hybridshapePoint As HybridShapePointCoord
Set hybridshapePoint = hybshpfact.AddNewPointCoord(XTxt.Text, YTxt.Text, ZTxt.Text)
HybBody.AppendHybridShape hybridshapePoint
part.UpdateObject hybridshapePoint
part.Update
End Sub
Private Sub NoBtn_Click()
Unload Me
End Sub
Every time i click create new geoSet is added and i want to create points in same geoset and not in new geoset and i want macro to create only one geoset i tried with while loop or if conditions but it didn't work
Any solution for this
I have created this userform to create point
Here is the macro code
Option Explicit
Private Sub OkBtn_Click()
Dim oDoc As Document
Set oDoc = CATIA.ActiveDocument
Dim partDoc As PartDocument
Set partDoc = CATIA.ActiveDocument
Dim part As part
Set part = CATIA.ActiveDocument.part
Dim HybBody As HybridBody
Set HybBody = part.HybridBodies.Add
part.InWorkObject = HybBody
Dim hybshpfact As HybridShapeFactory
Set hybshpfact = part.HybridShapeFactory
Dim hybridshapePoint As HybridShapePointCoord
Set hybridshapePoint = hybshpfact.AddNewPointCoord(XTxt.Text, YTxt.Text, ZTxt.Text)
HybBody.AppendHybridShape hybridshapePoint
part.UpdateObject hybridshapePoint
part.Update
End Sub
Private Sub NoBtn_Click()
Unload Me
End Sub
Every time i click create new geoSet is added and i want to create points in same geoset and not in new geoset and i want macro to create only one geoset i tried with while loop or if conditions but it didn't work
Any solution for this