DrawingView.IsTextPropertySource always returns False

DrawingView.IsTextPropertySource always returns False

nannerdw
Advocate Advocate
757 Views
4 Replies
Message 1 of 5

DrawingView.IsTextPropertySource always returns False

nannerdw
Advocate
Advocate

I can use a sheet's TextPropertySource to get a string representation of that drawing view's name.  However, getting the actual view object associated with that string is not as straightforward as it should be, since that string contains different information depending on whether the view contains model states or a snapshot view from an IPN file.  It also follows a slightly different naming convention than the DrawingView's BrowserNode name.

I would like to just loop through all drawing views on a sheet instead, and find the one that has IsTextPropertySource = True, but I think there is a bug in Inventor that prevents IsTextPropertySource from ever returning True.

0 Likes
758 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @nannerdw 

I don't see a DrawingView.IsTextPropertySource method in the API help. Can you explain a little more the method your looking to implement? Maybe how you would go about manually achieving the solution with some images etc.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

nannerdw
Advocate
Advocate

ThisDoc.ModelDocument returns the document that is associated with the first sheet's "Text Property Source" (which is assigned from the "Edit Sheet" dialog).
This document shows up as the <Primary Model> when adding iProperties to a text note.

 

However, there is no equivalent "Sheet.ModelDocument" in the API, which would allow me to get the "Text Property Source" document for all sheets of a drawing.

 

As a workaround, I wanted to use Sheet.TextPropertySource.  However, it only returns the DrawingView's name formatted in a non-standard way, rather than the DrawingView object itself.

 

As another workaround, I wanted to use DrawingView.IsTextPropertySource, except there is a bug that makes it always return False for every drawing view.

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

These are the links to the two properties being mentioned here:

DrawingView.IsTextPropertySource 

Sheet.TextPropertySource 

These are optional tools, and are only useful when you have more than one model file being directly referenced in the drawing document.  If you have a different model file being shown in views on each sheet of your drawing, you sometimes want the iProperty links shown on that sheet to only be referencing the model shown on that sheet, and that is where these tools can come in handy.  If you only have one model in your drawing, you can get a reference to that model using the simple ThisDoc.ModelDocument, or ThisDrawing.ModelDocument type iLogic snippets.  The DrawingView.IsTextPropertySource will likely remain False until you change it, either manually, or by code, on purpose, and will only work on 'Base View' type views.  Same with the Sheet.TextPropertySource...it will only return the 'regular' name of the view on that sheet that has been set as the source of iProperties on that sheet.  But if you have not specified any of them that way, it might simply be useless to you.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

nannerdw
Advocate
Advocate

What is the most robust way of detecting which model's iProperties are shown on a sheet?
I'm considering adding the <Primary or Attached Model>'s <FILENAME AND PATH> to my border on a hidden layer, so I can query its FormattedText and Text.

Alternatively, I might prompt the user to select a view if more than one model is present, so IsTextPropertySource can be assigned properly.

0 Likes