Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia VBA GeoSet

Status
Not open for further replies.

NaWin55

Mechanical
Joined
Mar 21, 2020
Messages
98
Location
IN
Hello
I have created this userform to create point
PointForm_je5oqs.jpg


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top