Matthieu44
Student
- Oct 18, 2021
- 1
Hi there I'm Matthieu, I'm new here. I'm doing my thesis on lattice structures.
I currently use Part design in 3D experience to create a lot of geometries of lattices with modified parameters (struts diameters for example)
I would like to make this parameters vary from i=0 to x, and at each iteration it saves me a step file so I use it on my meshing/simulation softwares, that will also be scripted.
Making my parameters vary is done, but i can't get the export .stp output,
Here is what I've tried.
Sub CATMain()
Dim i As Integer
Dim editor1 As Editor
Dim part1 As Part
Set editor1 = CATIA.ActiveEditor
Set part1 = editor1.ActiveObject
For i = 1 To 5
Dim parameters1 As Parameters
Set parameters1 = part1.Parameters
Dim strParam1 As Parameter
Set strParam1 = parameters1.Item("Fillets radius")
strParam1.Value = 0.01 * i
part1.Update
Dim PartDocument0 As Document
' Reading a CATPart file
Set PartDocument0 = CATIA.Documents.Open("C:\desktop\File1.CATPart")
' Saving the part in a STEP file
PartDocument0.ExportData("C:\desktop\File1", "stp")
Next
End Sub
It says that it needs '='a t the last line before Next,, when i put it it says that sub is not defined..
Can't seem to make the last part work. And I'm not really into scripting but really want to do this as I can learn a lot... Also the record function doesn't catch the exporting
And i Think cloud based stuff isn't very intuitive yet, I prefered how solidworks worked with good old desktop folders ahah!
Thanks a lot for any help!
Have a great day,
Matthieu.
I currently use Part design in 3D experience to create a lot of geometries of lattices with modified parameters (struts diameters for example)
I would like to make this parameters vary from i=0 to x, and at each iteration it saves me a step file so I use it on my meshing/simulation softwares, that will also be scripted.
Making my parameters vary is done, but i can't get the export .stp output,
Here is what I've tried.
Sub CATMain()
Dim i As Integer
Dim editor1 As Editor
Dim part1 As Part
Set editor1 = CATIA.ActiveEditor
Set part1 = editor1.ActiveObject
For i = 1 To 5
Dim parameters1 As Parameters
Set parameters1 = part1.Parameters
Dim strParam1 As Parameter
Set strParam1 = parameters1.Item("Fillets radius")
strParam1.Value = 0.01 * i
part1.Update
Dim PartDocument0 As Document
' Reading a CATPart file
Set PartDocument0 = CATIA.Documents.Open("C:\desktop\File1.CATPart")
' Saving the part in a STEP file
PartDocument0.ExportData("C:\desktop\File1", "stp")
Next
End Sub
It says that it needs '='a t the last line before Next,, when i put it it says that sub is not defined..
Can't seem to make the last part work. And I'm not really into scripting but really want to do this as I can learn a lot... Also the record function doesn't catch the exporting
And i Think cloud based stuff isn't very intuitive yet, I prefered how solidworks worked with good old desktop folders ahah!
Thanks a lot for any help!
Have a great day,
Matthieu.