C360_OnPublishDrawing not recognizing If Statement

C360_OnPublishDrawing not recognizing If Statement

kyle72833
Explorer Explorer
437 Views
4 Replies
Message 1 of 5

C360_OnPublishDrawing not recognizing If Statement

kyle72833
Explorer
Explorer

I am using the Rule “C360_OnPublishDrawing” to make a couple changes to a drawing based on user selections and I am having a problem with it when I upload to C360.  One section of the code in particular seems to not be working:

 

If Parameter("LDDSMaster.iam.EOD")=False

        ActiveSheet.View("VIEW1").View.BreakOperations(1).Delete

End If

 

 

What I want to happen is, if the EOD variable is False, I want all the drawing breaks to be deleted.  This rule works perfectly in Inventor 2019 but when I upload it to C360 something goes wrong and it deletes all breaks no matter what the EOD variable is. 

 

I'm successfully using the rest of the code in the rule to cleaning up dimensions, but the section to delete the drawing breaks is not working correctly.

0 Likes
Accepted solutions (1)
438 Views
4 Replies
Replies (4)
Message 2 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@kyle72833,

 

Can you please provide non confidential source code and model data to test the behavior?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 5

KKizildemir
Collaborator
Collaborator
Accepted solution

 

Hi @kyle72833 

 

Is 'LDDSMaster.iam' file your master assembly file? If it is, please insert the code into your 'C360_OnPublishDrawing' Rule.

 

Dim oDwgDoc As Inventor.DrawingDocument = ThisDoc.Document
Dim oAsmDoc As Inventor.AssemblyDocument = oDwgDoc.ReferencedDocuments.Item(1)
For Each oParam As Inventor.Parameter In oAsmDoc.ComponentDefinition.Parameters.UserParameters
	If oParam.Name = "EOD" Then
		If oParam.Value = False Then
			ActiveSheet.View("VIEW1").View.BreakOperations(1).Delete		
		End If
		Exit For
	End If
Next

Regards

 

Signature

website
emailskypelinkedinyoutubeemail
0 Likes
Message 4 of 5

kyle72833
Explorer
Explorer

This worked perfectly.  Thank you for your help.


@KKizildemir wrote:

 

Hi @kyle72833 

 

Is 'LDDSMaster.iam' file your master assembly file? If it is, please insert the code into your 'C360_OnPublishDrawing' Rule.

 

Dim oDwgDoc As Inventor.DrawingDocument = ThisDoc.Document
Dim oAsmDoc As Inventor.AssemblyDocument = oDwgDoc.ReferencedDocuments.Item(1)
For Each oParam As Inventor.Parameter In oAsmDoc.ComponentDefinition.Parameters.UserParameters
	If oParam.Name = "EOD" Then
		If oParam.Value = False Then
			ActiveSheet.View("VIEW1").View.BreakOperations(1).Delete		
		End If
		Exit For
	End If
Next

Regards

 


 

 

0 Likes
Message 5 of 5

KKizildemir
Collaborator
Collaborator

You're welcome. Don't forget to subscribe Codeo Youtube Channel to get interesting ideas about C360!

Signature

website
emailskypelinkedinyoutubeemail
0 Likes