Unique view names?

Unique view names?

CadUser46
Collaborator Collaborator
495 Views
6 Replies
Message 1 of 7

Unique view names?

CadUser46
Collaborator
Collaborator

Since it's possible for two views to have the same name, is there a better method to identify them in the API?

 

I'm trying to cross reference which balloons are attached to which views but not being able to identify them uniquely with a GUID or such is causing a problem.


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

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Accepted solutions (1)
496 Views
6 Replies
Replies (6)
Message 2 of 7

BrandonBG
Collaborator
Collaborator

Can you use DrawingViews.Item()? Then item numbers don't mean anything, but I believe all views are unique on a sheet. Beyond the sheet, I don't know how this would be useful.

 

Brandon

0 Likes
Message 3 of 7

CadUser46
Collaborator
Collaborator

It;s an idea and i'll look into it but i'm not currently accessing the drawing views collection.  I think I'd still need to identify which ones are in the selectset against the collection using name.


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

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 4 of 7

HermJan.Otterman
Advisor
Advisor

you could add an attribute to each view...

 

then you'll have to write some code for every time you create a new view that an attribte is added with maybe the time or an other number

 

then you can use that attribute you ID the view...

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 5 of 7

CadUser46
Collaborator
Collaborator

Herman.  I'm not familiar with Attribute's.  Can you elaborate a bit further?

 

Are the attributes permanent or only have scope during runtime?  I only need to care when the macro is run so I guess I could iterate all the views on a sheet and add them each time.


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

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 6 of 7

HermJan.Otterman
Advisor
Advisor
Accepted solution

Hello CadUser,

 

 

look at these sites:

 

 

http://modthemachine.typepad.com/my_weblog/2009/07/introduction-to-attributes.html

 

http://modthemachine.typepad.com/my_weblog/attributes/

 

 

 

 

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 7 of 7

CadUser46
Collaborator
Collaborator

Thanks Herman.  I'd read this a long time ago but never connected the dots before now.


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

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes