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: 

API revision question for my own edification

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
438 Views, 5 Replies

API revision question for my own edification

I had an addin I wrote that has a rename drawing view function,
and I had previously added a DrawView.ShowName = true statement
to turn on the view label if it was off.

Upon running it recently on IV2009, I git a run-time error 80004005
Method '~' of object '~' failed, and upon tracking this down I found
that according to the docs for IV2009, ShowName has been removed
(and replaced with ShowLabel).

But, the interesting thing which I'd like to know, is why does the
label still get turned on even when I was still calling ShowName?
Apparently ShowName is still valid because after changing it to
ShowLabel, I still am getting the error and now I am thinking it
has to do with trying to end a transaction instead.

Bob S.
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

ShowName wasn't removed but has been hidden, along with ShowScale. Even
though they're hidden they can still be used and now have the same effect as
calling the new ShowLabel property. This is in reaction to a change in
Inventor. Previously to Inventor 2009 the scale and name were seperate and
you could control the display of them independently. Inventor 2009 now
supports a general and more powerful view labeling mechanism. The view
label is text that can contain fields for the view name and scale, plus
other values just like you can use in other text notes (iProperties, etc.).
The API had to react to this change in Inventor.

Earlier code that used these properties will still work but you might not
get quite the results you expected. For example, if you program turns off
the scale but expects the name to still be there, since the name will get
turned off when you turn the scale off since they're both part of the new
single view label.

As you suspected the problem must be from something else.
--
Brian Ekins
Autodesk Inventor API
Message 3 of 6
Mike_Maenpaa
in reply to: Anonymous


@Anonymous wrote:
ShowName wasn't removed but has been hidden, along with ShowScale. Even
though they're hidden they can still be used and now have the same effect as
calling the new ShowLabel property. This is in reaction to a change in
Inventor. Previously to Inventor 2009 the scale and name were seperate and
you could control the display of them independently. Inventor 2009 now
supports a general and more powerful view labeling mechanism. The view
label is text that can contain fields for the view name and scale, plus
other values just like you can use in other text notes (iProperties, etc.).
The API had to react to this change in Inventor.

Earlier code that used these properties will still work but you might not
get quite the results you expected. For example, if you program turns off
the scale but expects the name to still be there, since the name will get
turned off when you turn the scale off since they're both part of the new
single view label.

As you suspected the problem must be from something else.
--
Brian Ekins
Autodesk Inventor API

Can you show me an example of how to do this?

I want to leave the View Name shown, but turn the Scale off.

 

Thanks!

 

Mike

 

Message 4 of 6
Mike_Maenpaa
in reply to: Mike_Maenpaa

I have already adjusted the View Annotation style, but it would be nice to be able to do this with a click of a button instead of having to right-click the label and delete the scale on every view.

Anyone have any idea on this?

 

Thanks!

 

Mike

Message 5 of 6
YuhanZhang
in reply to: Mike_Maenpaa

If there is no exceptional view that you can use below VBA to do this:

Sub ShowViewName()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oView As DrawingView
    For Each oView In Me.Sheets(1).DrawingViews
        oView.Label.FormattedText = "<DrawingViewName/>"
        oView.ShowLabel = True
    Next
End Sub

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 6 of 6
Mike_Maenpaa
in reply to: YuhanZhang

Thanks Rocky, but I've altready been able to do what you have shown.

I want to turn off the View Scale.

 

Thanks!

 

Mike

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

Post to forums  

Autodesk Design & Make Report