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 Macro-Crete part with naming

Status
Not open for further replies.
Hi everyone, i an new making Catia VBA macros. I started to make VBA macro for creating new part with naming file directly to in macro.
here is the problem that i have:
1. I created the simple code to make catpart (code below) and i would like to change yelow line with usser form like in the picture
Does any one knows how to do that?
Sub CATMain()
Dim Part_Name As String
[highlight #FCE94F]Part_Name = InputBox("Please enter part name and use define profile")[/highlight]


Dim documents1 As Documents
Capture_tbppcm.jpg

Set documents1 = CATIA.Documents

Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Add("Part")
Set product1 = partDocument1.GetItem("Part1")

product1.PartNumber = Part_Name

End Sub

I would really appreciate any help
 
@catiavbmacro
yes, i made my macro acc this but i would like to replace msg box with userform from the picture above
and I don't know how to do that
any hint?
 
Hello, I don't use VBA, I use Visual Basic but I think it's the same.

You can go something like this.
Part_Name = textbox.1.text or
Part_Name = label.text
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top