Ilogic gives error if part is not inside assembly when i try to update parameters

Ilogic gives error if part is not inside assembly when i try to update parameters

Charlies_3D_T
Advocate Advocate
417 Views
3 Replies
Message 1 of 4

Ilogic gives error if part is not inside assembly when i try to update parameters

Charlies_3D_T
Advocate
Advocate

Hello,

 

I am writing an ilogic that changes a lot of parameter in part level inside an assembly. Now it's an assembly where some sub assemblies are suppressed. So here my problem starts. If i want to send a parameter to a part that exists but is suppressed inside the assembly i get an error. Is there a simple solution that it just ignores this and go to the next line of code?

 

Thank you!

0 Likes
Accepted solutions (1)
418 Views
3 Replies
Replies (3)
Message 2 of 4

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Charlies_3D_T 

If you want to ignore errors and just proceed to the next line of code, have you tried just adding the line:

On Error Resume Next

At the top of your code? 🙂

0 Likes
Message 3 of 4

Charlies_3D_T
Advocate
Advocate

@JhoelForshav

 

Haha that fixed it never tought about that command! Thanks! 

 

But also a question is there an option that it collects all the errors and shows them at the end of the ilogic what parts that were missing?  

0 Likes
Message 4 of 4

JhoelForshav
Mentor
Mentor

Hi @Charlies_3D_T 

If you have the component-names in a changing variable you could do something like this example:

Sub Main

Dim oReturnString As String = "Errors:"
Dim oName As String

On Error GoTo ErrorLine
oName = "Comp1"
MsgBox(ThisApplication) 'Something that causes an error

oName = "Comp2"
MsgBox(ThisApplication) ''Something that causes an error

MsgBox(oReturnString)

Exit Sub
ErrorLine :
oReturnString = oReturnString & vbCrLf & oName
Resume Next

End Sub

 

0 Likes