Sebek
Mechanical
- Jan 23, 2019
- 6
Hello
My code looks something like this i want to do a macro to making a new part in specific location and specific part name and file name i manage to make this macro by recording it in catia. Now i want to have something like a popout table where i can write the location, part name and file name. The popout table i want to be allways in the window. Can somebody help me with this i'm new in catia scripting.
Thanks
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set products1 = product1.Products
Set product2 = products1.AddNewComponent("Part", "")
Set documents1 = CATIA.Documents
Set partDocument1 = documents1.Item("Part1.CATPart")
Set product1 = partDocument1.GetItem("Part1")
product1.PartNumber = "RDB-4803-0-00-00-00-00"
product1.Revision = "--"
product1.Definition = "--"
product1.Nomenclature = "Part1"
product1.DescriptionRef = "--"
Set productDocument1 = CATIA.ActiveDocument
Set product2 = productDocument1.Product
Set products1 = product2.Products
Set productDocument1 = CATIA.ActiveDocument
Set documents1 = CATIA.Documents
Set partDocument1 = documents1.Item("Part1.CATPart")
partDocument1.SaveAs "C:\Users\Sebastian\Desktop\product\Part1.CATPart"
End Sub
My code looks something like this i want to do a macro to making a new part in specific location and specific part name and file name i manage to make this macro by recording it in catia. Now i want to have something like a popout table where i can write the location, part name and file name. The popout table i want to be allways in the window. Can somebody help me with this i'm new in catia scripting.
Thanks
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set products1 = product1.Products
Set product2 = products1.AddNewComponent("Part", "")
Set documents1 = CATIA.Documents
Set partDocument1 = documents1.Item("Part1.CATPart")
Set product1 = partDocument1.GetItem("Part1")
product1.PartNumber = "RDB-4803-0-00-00-00-00"
product1.Revision = "--"
product1.Definition = "--"
product1.Nomenclature = "Part1"
product1.DescriptionRef = "--"
Set productDocument1 = CATIA.ActiveDocument
Set product2 = productDocument1.Product
Set products1 = product2.Products
Set productDocument1 = CATIA.ActiveDocument
Set documents1 = CATIA.Documents
Set partDocument1 = documents1.Item("Part1.CATPart")
partDocument1.SaveAs "C:\Users\Sebastian\Desktop\product\Part1.CATPart"
End Sub