Error during saving drawing containing iLogic

Error during saving drawing containing iLogic

Anonymous
Not applicable
1,260 Views
9 Replies
Message 1 of 10

Error during saving drawing containing iLogic

Anonymous
Not applicable

Hello,

 

Since our company made the exchange to Inventor 2018, a lot of errors occured. One of the errors is this one:

 

2018-02-14_10-14-52.png2018-02-14_10-15-19.png

 

I'm just a junior engineer, so I am not experienced with errors. Also my collegues don't know where these errors come from. The only thing we know for sure is that there is something wrong in the iLogic rules. The iLogic rules are as follow:

ActiveSheet = ThisDrawing.Sheet("Sheet:3")

If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_1")=0 Then
ActiveSheet.View("VIEW 1").View.Suppressed=True
ActiveSheet.View("VIEW 1A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 1").View.Suppressed=False
ActiveSheet.View("VIEW 1A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_2")=0 Then
ActiveSheet.View("VIEW 2").View.Suppressed=True
ActiveSheet.View("VIEW 2A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 2").View.Suppressed=False
ActiveSheet.View("VIEW 2A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_3")=0 Then
ActiveSheet.View("VIEW 3").View.Suppressed=True
ActiveSheet.View("VIEW 3A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 3").View.Suppressed=False
ActiveSheet.View("VIEW 3A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_4")=0 Then
ActiveSheet.View("VIEW 4").View.Suppressed=True
ActiveSheet.View("VIEW 4A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 4").View.Suppressed=False
ActiveSheet.View("VIEW 4A").View.Suppressed=False
End If

If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_5")=0 Then
ActiveSheet.View("VIEW 5").View.Suppressed=True
ActiveSheet.View("VIEW 5A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 5").View.Suppressed=False
ActiveSheet.View("VIEW 5A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_6")=0 Then
ActiveSheet.View("VIEW 6").View.Suppressed=True
ActiveSheet.View("VIEW 6A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 6").View.Suppressed=False
ActiveSheet.View("VIEW 6A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_7")=0 Then
ActiveSheet.View("VIEW 7").View.Suppressed=True
ActiveSheet.View("VIEW 7A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 7").View.Suppressed=False
ActiveSheet.View("VIEW 7A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_8")=0 Then
ActiveSheet.View("VIEW 8").View.Suppressed=True
ActiveSheet.View("VIEW 8A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 8").View.Suppressed=False
ActiveSheet.View("VIEW 8A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_9")=0 Then
ActiveSheet.View("VIEW 9").View.Suppressed=True
ActiveSheet.View("VIEW 9A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 9").View.Suppressed=False
ActiveSheet.View("VIEW 9A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_10")=0 Then
ActiveSheet.View("VIEW 10").View.Suppressed=True
ActiveSheet.View("VIEW 10A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 10").View.Suppressed=False
ActiveSheet.View("VIEW 10A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_11")=0 Then
ActiveSheet.View("VIEW 11").View.Suppressed=True
ActiveSheet.View("VIEW 11A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 11").View.Suppressed=False
ActiveSheet.View("VIEW 11A").View.Suppressed=False
End If


If Parameter("400-02CW1-47-D2-SS.iam.X_FLOORLEG_12")=0 Then
ActiveSheet.View("VIEW 12").View.Suppressed=True
ActiveSheet.View("VIEW 12A").View.Suppressed=True
Else 
ActiveSheet.View("VIEW 12").View.Suppressed=False
ActiveSheet.View("VIEW 12A").View.Suppressed=False
End If

 

In this case, the assembly is called "400-02CW1-47-D2-SS.iam". As we copy the assembly multipile times and use therefore different floorbeams, we suppress some of the floorbeams. If they are suppressed in the assembly, we won't have them on the drawing.

Sheet 1 and 2 contains global information of the position of the floorbeams, sheet 3 contains the sizes of the parts of every individual floorbeam.

 

If I run this code while in sheet 3, the error only occurs 1 time and I'm able to continue my work. However, if I run this code while I'm in sheet 2, the error occurs a lot of times. (Today I had to make an construcion on my keyboard so I didn't have to press the enter-button all the time by myself, after 30 minutes I had to close Inventor using task manager.)

 

The question is, what is the reason that the error occurs and how can we fix this?

0 Likes
Accepted solutions (1)
1,261 Views
9 Replies
Replies (9)
Message 2 of 10

Thomas_Savage
Advisor
Advisor

Hello @Anonymous

 

The link below is for Inventor Customization.

 

https://forums.autodesk.com/t5/inventor-customization/bd-p/120

 

This forum is for iLogic.

 

You will be better posting here. So experts can help you solve your problem.

 

Thomas.

 

 



Thomas Savage

Design Engineer


0 Likes
Message 3 of 10

Mark.Lancaster
Consultant
Consultant

@Anonymous

 

I've requested for your posting to be relocated to the Inventor Customization forum.

 

@Thomas_Savage

 

For the future you can just request that using the report button..  Smiley Wink

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

Message 4 of 10

Thomas_Savage
Advisor
Advisor

@Mark.Lancaster Thank you. 

 

I didn't know that.

 

Will use the report button next time.

 

Thomas.



Thomas Savage

Design Engineer


0 Likes
Message 5 of 10

MechMachineMan
Advisor
Advisor

Where is this rule located? In a drawing template?

 

Also, in the drawing parameters, is there really a parameter named "

"400-02CW1-47-D2-SS.iam.X_FLOORLEG_1"

and so on? 

 

At a glance, it looks like the rule might have had some quotation marks and a comma deleted, but I can't be sure.

 

Also, is the model that has the floor beams and such simply 'pack-and-go'ed for each project, or do you reference the same frame for all projects from a library?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 6 of 10

MechMachineMan
Advisor
Advisor

Here is some samples and how it works. I have verified it works for a part of the corresponding name and the existence of parameters, sheet names, view names of that in the code.

 

Possible reasons your code isn't working:

1. The sheet names in the document doesn't match the sheet name in the code.

2. The parameter doesn't match the name of a DRAWING parameter if it is supposed to be the drawing parameter referenced. These parameters are different from part parameters.

3. The parameter has had the quotation marks and a comma deleted in it, in the case it actually is supposed to refer to the model parameter.

4. Your view names do not match those in the code.

 

'This grabs the sheet with the exposed sheet name "Sheet:1".
'It will not work properly if you revise the sheet name
'The below line is always to be active
ActiveSheet = ThisDrawing.Sheet("Sheet:1")


''param1 is a drawing parameter
'If Parameter("param1")=True Then
'   '"VIEW1" etc are the ACTUAL names of the view. It will not work as expected if view names have been changed
'	ActiveSheet.View("VIEW1").View.Suppressed=True
'	ActiveSheet.View("VIEW2").View.Suppressed = False
'Else 
'	ActiveSheet.View("VIEW2").View.Suppressed=True
'	ActiveSheet.View("VIEW1").View.Suppressed = False
'End If

'If above is uncommeneted, comment the below code out and vice versa.

'part1.ipt is the FILE NAME of the part in the drawing
'PartParam is the parameter name of of a parameter in the part
If Parameter("Part1.ipt", "PartParam")= True Then
	ActiveSheet.View("VIEW1").View.Suppressed = True
	ActiveSheet.View("VIEW2").View.Suppressed = True
Else 
	ActiveSheet.View("VIEW2").View.Suppressed = False
	ActiveSheet.View("VIEW1").View.Suppressed = False
End If

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 7 of 10

MechMachineMan
Advisor
Advisor
Accepted solution

Try this line and see if it works. If it does, we know the parameters have comma/quotes missing.

 

errfound = false

ActiveSheet = ThisDrawing.Sheet("Sheet:3")
Dim int as Integer
int = Parameter("400-02CW1-47-D2-SS.iam", "X_FLOORLEG_1")

MsgBox(int & vblf & vblf & "It would appear the parameter is intended for the assembly, instead of the drawing as your forum code has it written")

Try
If int=0 Then
ActiveSheet.View("VIEW 1").View.Suppressed=True
ActiveSheet.View("VIEW 1A").View.Suppressed=True
Else
ActiveSheet.View("VIEW 1").View.Suppressed=False
ActiveSheet.View("VIEW 1A").View.Suppressed=False
End If
Catch
MsgBox("Error found with view names!")
errfound = True
End try

If errfound = False
MsgBox("Rule ran without error!")
End if

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 8 of 10

bradeneuropeArthur
Mentor
Mentor

In general there need to be used comma' s


This is the method be used:
If Parameter("400-02CW1-47-D2-SS.iam    ,       X_FLOORLEG_2")=0 Then

This is in all cases wrong....

You wrote like below:

If Parameter("400-02CW1-47-D2-SS.iam    .        X_FLOORLEG_2")=0 Then

 

If you have any questions regarding this, please let me know.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 10

johnsonshiue
Community Manager
Community Manager

Hi! Is the assembly of interest here located in a Library folder? If yes, this is known change in 2018. Inventor API no longer allows you to overwrite a library component. There are two ways to resolve the issue. You can either create a new project which allow you to edit the library components or set an application property (as of 2018.2 update).

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 10 of 10

Anonymous
Not applicable

Thank you! This code helped me a lot! It was indeed the comma/quotes problem.

0 Likes