Hi.
I am trying to build a new macro for Frame and Title block for my company. I have been learning CATIA Scripting for 2 weeks. I want to insert some Parameters which will be later used for populating Title block. After I had defined desired parameters I encountered a problem with duplication of parameters for each new sheet. So I defined "If-Then" statement to prevent parameters` creation if parameters already exist, but it didn`t work. Parameters aren`t being created. If I delete If-Then statement parameters will be created. Does anyone have a solution for this kind of problem?
Here is part of my code:
Dim objParams As Parameters
Dim objParam As Parameter
Set objParams = CATIA.ActiveDocument.Parameters
If objParams.Count = 0 Then
Set objParam = DrwDocument.Parameters.CreateString ("Uradio", "M.Milasinovic")
Set objParam = DrwDocument.Parameters.CreateString ("Odobrio", "N.Jankovic")
Set objParam = DrwDocument.Parameters.CreateString ("Br.projekta", "V-20")
Set objParam = DrwDocument.Parameters.CreateString ("ID.projekta", "A2V0000")
Set objParam = DrwDocument.Parameters.CreateString ("Model", "RRX")
End If
Regards,
Marko!
I am trying to build a new macro for Frame and Title block for my company. I have been learning CATIA Scripting for 2 weeks. I want to insert some Parameters which will be later used for populating Title block. After I had defined desired parameters I encountered a problem with duplication of parameters for each new sheet. So I defined "If-Then" statement to prevent parameters` creation if parameters already exist, but it didn`t work. Parameters aren`t being created. If I delete If-Then statement parameters will be created. Does anyone have a solution for this kind of problem?
Here is part of my code:
Dim objParams As Parameters
Dim objParam As Parameter
Set objParams = CATIA.ActiveDocument.Parameters
If objParams.Count = 0 Then
Set objParam = DrwDocument.Parameters.CreateString ("Uradio", "M.Milasinovic")
Set objParam = DrwDocument.Parameters.CreateString ("Odobrio", "N.Jankovic")
Set objParam = DrwDocument.Parameters.CreateString ("Br.projekta", "V-20")
Set objParam = DrwDocument.Parameters.CreateString ("ID.projekta", "A2V0000")
Set objParam = DrwDocument.Parameters.CreateString ("Model", "RRX")
End If
Regards,
Marko!