Is there a child complement to <PARENT SHEET INDEX> ?

Is there a child complement to <PARENT SHEET INDEX> ?

claudio.ibarra
Advocate Advocate
4,389 Views
29 Replies
Message 1 of 30

Is there a child complement to <PARENT SHEET INDEX> ?

claudio.ibarra
Advocate
Advocate

I can use <PARENT SHEET INDEX> to produce a Detail view label for DETAIL "B" on Sheet 3 that highlights it comes from a Section View on Sheet 2. But can I put something (dynamically linked) on the Section View on Sheet 2 to indicate the user should look at Sheet 3 to find the Detail View?

0 Likes
Accepted solutions (3)
4,390 Views
29 Replies
Replies (29)
Message 2 of 30

johnsonshiue
Community Manager
Community Manager

Hi Claudio,

 

I guess there is no such thing. The issue here is that a parent view can have multiple children in different sheets. Which one  would you tag?

Many thanks!



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

claudio.ibarra
Advocate
Advocate

For example:

 

I have Detail "B" on Sheet 3 that comes from a view on Sheet 2. The label for Detail "B" uses <PARENT SHEET INDEX> to reference Sheet 2. But how can I add something to the Detail "B" annotation on Sheet 2 that tells me to look on Sheet 3 for Detail "B" and not Sheet 6? At least, how to add a dynamic link; I can add static text, but it'll be wrong as soon as I move the Detail to another sheet. Is it possible to provide a reference in both directions?

Message 4 of 30

MjDeck
Autodesk
Autodesk

I'm pretty sure it's possible to do this with an iLogic rule, using the Inventor API.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 5 of 30

claudio.ibarra
Advocate
Advocate

How would that be enacted? Run a drawing-wide rule to update those links, once it's setup? (I have no real experience with the API, though I wish I were adept at it). 

0 Likes
Message 6 of 30

MjDeck
Autodesk
Autodesk

Yes, a single rule could iterate over all the views in a drawing and modify view labels as required. I could try to put a rule together.
I'm not thinking of actual links. It would just be text.


Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 30

claudio.ibarra
Advocate
Advocate

Please forgive my ignorance, but can you describe the process that the code would run through in vague terms?

 

I don't know the syntax, but broadly does it need to somehow "get" the object of the drawing, then iterate through all sheets, then through all views, then only the views that have words like "detail" or "section", maybe even projection. Does it, can it check to see if it's on the same page? Is it possible to check whether or not a view is on the same sheet and omit sheet reference labels in that case, applying them only if the views are not on the same sheet?

0 Likes
Message 8 of 30

MjDeck
Autodesk
Autodesk

The drawing object is available in the ThisDrawing.Document object.

You don't have to rely on the view names. The DrawingView object will tell you if it's a detail or section view.

If a view is a child, it will have a reference to its parent. And each view has a reference to the sheet it's on. So you can tell if a view is on the same sheet as its parent, and only modify the labels on views that have children on another sheet.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 9 of 30

claudio.ibarra
Advocate
Advocate

So it's possible to have a rule that executes on the drawing whenever some change criteria is met that runs through and adds (or updates) the "child" index to any section/detail view where the parent/child index numbers don't match? 

0 Likes
Message 10 of 30

MjDeck
Autodesk
Autodesk

Unfortunately there aren't enough events available in iLogic. The best you can do is to add an event trigger on the Before Save Document event. That way, you will never save the drawing with an out-of-date child index.

But if you create or move a view and want to see the results before you save, you will have to run the rule manually.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 11 of 30

claudio.ibarra
Advocate
Advocate

Thank you for your help! I don't think I'll be able to write a rule like that anytime soon, but it's good to know it might be possible. 

0 Likes
Message 12 of 30

MjDeck
Autodesk
Autodesk
Accepted solution

The attached rule does something like what you're asking for. I tested it in Inventor 2020. It should also work in earlier versions. The formatting of the text in the label can be changed.

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 13 of 30

claudio.ibarra
Advocate
Advocate

Thank you so much! I really appreciate it. Please also help me understand how to make it work -- should I un-comment some of the lines? I created a rule with the txt contents, it ran without error, but nothing changed on a Detail view with the parent on sheet 2 and child on sheet 3.

0 Likes
Message 14 of 30

MjDeck
Autodesk
Autodesk

You shouldn't have to uncomment any lines. But it will only change the label on the parent view, not on the detail. Is the label of the parent view visible in your drawing?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 15 of 30

claudio.ibarra
Advocate
Advocate

Ah yes, it works as you describe! I will mark it as solved, because that is the kind of thing I was looking for. Thank you!

 

If I bring back the detail views so they're all on their respective sheets, does the parent label go blank or leave one entry?

 

I'm sorry, I did have that parent view label turned off, and was instead looking at the boundary rectangle/circle for the detail on that parent view itself. I don't suppose it's possible to have the number appear in the label that marks the detail, so if Detail F was on another page the boundary would be F-# or F:# or some other formatting that included the page where you can find the detail?

0 Likes
Message 16 of 30

MjDeck
Autodesk
Autodesk

Now I have a better idea of what you're looking for. The sheet index should not go on the parent view label, but rather in the text associated with the boundary rectangle/circle (fence) for the detail. And that makes more sense. Listing everything in the parent view label is not very useful.

Unfortunately, the detail view fence and associated text is not available to the API. So iLogic can't be used to edit it.

About your other question: no, my rule won't update the parent view label correctly if you move a detail view back onto the parent sheet. That would take a bit of work to fix. I can do it if you think you'll use the rule.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 17 of 30

claudio.ibarra
Advocate
Advocate

Thank you! I do think we will happily use the rule. It's one of my goals to automate as many of the small details as possible so we can focus on the more creative things. I would setup an external rule the whole team can use that fires whenever the drawing is saved. It can be very convenient to group detail views on latter sheets in a large multi-page assembly or weldment drawing, and having bi-directional automatic referencing is extremely valuable.

 

Something like this: 

 

Annotation 2020-01-02 120317.png

0 Likes
Message 18 of 30

MjDeck
Autodesk
Autodesk
Accepted solution

Here's a new version of the rule. This should edit the labels if the child views are moved. It will only change labels on views that it has modified before.

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 19 of 30

claudio.ibarra
Advocate
Advocate

Thank you again!! If you don't mind, I would like to give you attribution when I submit this as an idea for a feature in future versions of Inventor.

 

I hope you don't mind some followup questions:

 

  • Do I need to comment out the "Logger.Info" on lines 70, 71, 72?
  • Is the formatting controlled in the rule itself? I want to understand how to control the size/boldness of the text after the delimiter, as well as how to control "A-A" vs "A" in the label. 

Annotation 2020-01-07 083651.png

 

0 Likes
Message 20 of 30

MjDeck
Autodesk
Autodesk
Accepted solution

If you are running Inventor 2018 or earlier, then you need to comment out the Logger.Info lines.
Yes, the formatting is controlled by the rule itself.
Here's a new version of the rule. It provides two formatting options:
Const DashInSectionViewNames = True
Const ChildListInBold = True
They are documented in the rule code.

 

If you have a specific format that you're looking for, you can edit the view label in the UI and then use the other attached rule (ListViewLabels.txt) to see the FormattedText as it appears to the API. (This requires Logger.Info. If you're using Inventor 2018 or earlier, you'll have to change that. MessageBox.Show would work.)


Mike Deck
Software Developer
Autodesk, Inc.