Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Mar 21, 2020
97
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
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top