Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drawing view suppression rule

2 REPLIES 2
Reply
Message 1 of 3
fishernow
432 Views, 2 Replies

Drawing view suppression rule

Hi everyone,

I am stuck trying to find a way to suppress drawing views and drawing sheets. I have a model that consists of several parts and with ilogic in the model, I can suppress the components if i don't need them and that's all good. My drawing consists of several sheets with several views, the suppressed parts are remaining active even though the parts are suppressed in the model.

Q1- Why are the views not turned off or suppressed with the model part suppression?
Q2- When I try to use ilogic to suppress a view or the sheets I get the errors below.

Drawing view suppression rule:

If Parameter("105088 Shelves & Dividers Assembly.iam.s2sp2") = 0 Then
ActiveSheet.View("VIEW12") = False
End If

Rule Compile Errors in viewoff, in 105088 Shelves & Dividers Assembly.idw
Error on Line 2 : Property 'View' is 'ReadOnly'.

****************************************************************************************
Sheet suppression rule:

If Parameter("105088 Shelves & Dividers Assembly.iam.s2sp2") = 0 Then
ActiveSheet = ThisDrawing.Sheet("Sheet DP Shelf 1&2 :2") = False

End If

Rule Compile Errors in viewoff, in 105088 Shelves & Dividers Assembly.idw
Error on Line 2 : Operator '=' is not defined for types 'Autodesk.iLogic.Interfaces.ICadDrawingSheet' and 'Boolean'.

************************************
Drawing parameter rule:

If Suppress_Sheets = True Then
ActiveSheet.View("VIEW1") = False
End If

Rule Compile Errors in Rule2, in 105088 Shelves & Dividers Assembly.idw
Error on Line 2 : Property 'View' is 'ReadOnly'.

Thanks,
Eric
2 REPLIES 2
Message 2 of 3
montylowe
in reply to: fishernow

Hey Eric any luck with this one???

Message 3 of 3
MegaJerk
in reply to: fishernow

Use something like this:

 

 

ThisDrawing.Sheet("Sheet:2").View("Part1").View.Suppressed = False

Now if you’re throwing your representations on to a sheet (no matter if they are flat patterns or isometric who knows what) they will have a view name that you give them on creation. You can see what this view name is (AKA: View Identifier) when you double click on them (Right click à Edit View), and look at the bottom.

 

In the case above, I am looking at a View Identifier called Part1 on the sheet called Sheet.

 

Note that when you change the View name of your representation, you will need to update the rule to follow that!

 

Note 2: ALSO please look at the wording of the above code! See how it’s asking if the state is suppressed unlike how it states the suppressed (IsActive) state for the assembly. The above code is saying that it’s NOT suppressed. 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report