_Document vs Document

_Document vs Document

Anonymous
Not applicable
894 Views
2 Replies
Message 1 of 3

_Document vs Document

Anonymous
Not applicable

Hi..  I´m a little insecure on this issue. Hope someone can straighten it out.

 

The eventhandler for ApplicationEvents.OnSaveDocument first parameter is of the type _Document

 

There is no search results in the help file ( nor this forum or related blogs ) for _Document except for an example on the use of DrawingViews.AddBaseView() where it also shows up as the first parameter.

 

Is _Document the exact same type as Document ? Changing the type to Document in the eventhandler compiles and works?  What´s the catch?? Is this a consistent naming convention throughout the API ( Is _Application the same as Application )  

 

Just to elaborate on my confusion:  Do not use underscores, hyphens, or any other nonalphanumeric characters.

 

Some clarification would be most appreciated

0 Likes
Accepted solutions (1)
895 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

If you look at the definition of each then it seems that _Document is the class and Document is the interface. 

 

As you can see it's not Inventor specific as you can find similar things about Word: http://www.add-in-express.com/forum/read.php?FID=5&TID=3388

 

You should just use whatever is offered by Visua Studio when creating the event handler.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks alot for your reply Adam!

 

So if I understand this right Document is upcasted to _Document in the eventhandler & that´s why it works anyway.

 

Makes sense..  I just get a little nervous when unexposed ( and unexplained ) classes show up Smiley Wink

0 Likes