Changes to Drawing API Events when placing a base view of part in 2019

Changes to Drawing API Events when placing a base view of part in 2019

kmiller
Collaborator Collaborator
698 Views
8 Replies
Message 1 of 9

Changes to Drawing API Events when placing a base view of part in 2019

kmiller
Collaborator
Collaborator

We have some custom programming that runs when a baseview is placed on a sheet.  Basically it's taking and automating a note that goes into the center of the view (i.e. the part number/name) when placed.  Currently this runs during OnDocumentChange event.  In 2018 this works fine as you place the view.  The code fires after initial view placement.  I have been working on upgrading our programs to inventor 2019 interop and .net 4.7.  After changing this one, our OnDocumentChange code fires before the actual base view is placed on the sheet causing undesired results. (i.e. the text is placed at 0,0 because the view position is invalid)  I have run the eventwatcher tool from the SDK and found that in 2019 an OnDocumentChange event with an internal name of "EditDrawingBaseView" is actually being fired and in 2018 this does not.  I have searched and searched trying to find if and/or what may have changed in this regards in 2018 vs 2019 but haven't come up with anything I would say is pinpointing my issue other than this additional change firing.  I will attach a word doc of my comparison.  Can anyone shed any light on this for me?  

 

Thanks in Advance.

   

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
699 Views
8 Replies
Replies (8)
Message 2 of 9

kmiller
Collaborator
Collaborator

When stepping through code we are also seeing a CommandTypeEnum of 65 being pushed through when OnDocumentChange is firing.  Does anyone know what 65 means?  Is it a combination of CommandTypeEnum numerical values?  so there is potentially two being passed?

 

PS - Windows 7, Inventor 2019.1 as well as tested with 2019.1.2.

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 3 of 9

kmiller
Collaborator
Collaborator

We feel we have gotten a work around and fix for this issue as we coded some triggers to handle the changes to whatever onDocumentChange events fire in terms of handling drawing views.  We believe data used to be accessible before the drawing view was placed in memory that we where accessing and now this data isn't available until after placement/update of drawing.  If there are any auto desk developers out there that can shed any light on the subject I would be interested in hearing your thoughts.  For now, we just modified things to fit the way inventor 2019 worked.  

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 4 of 9

chandra.shekar.g
Autodesk Support
Autodesk Support

@kmiller,

 

Can you please provide source code and steps to reproduce? Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 9

kmiller
Collaborator
Collaborator

There really isn't any sample files I can send unless I send you the entire source code for our project (and it's kind of a lot). 

Testing our custom code by having a blank drawing open and placing the base view of a part.  We have some code that automatically pulls the piece number from the referenced part file name and puts a general note in the center of the view by creating a point and placing the text at that point. 

Basically can you confirm if the order of operation changed from 2018 to 2019 when you place a base view on a shop drawing (we use .dwg format)?  Because the view info is no longer available through first time run in ondocumentchange but is available when the ondocumentchange is done after the ok button is pressed.  Before the, ok button press never triggered another ondocumentchange it just closed the dialog it seemed.  All the work was applied as you made changes.  It now seems it applies the changes only after ok is pressed (drawing view dialog when placing a base view). It still triggers ondocumentchange events as you make changes it just does not have info from the drawing to work off of.  You would need to grab info from the view itself that is not applied to the drawing yet and possibly this is now contained in some memory object?

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 6 of 9

chandra.shekar.g
Autodesk Support
Autodesk Support

@kmiller

 

For more understanding, Can you please demonstrate the scenario with video record?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 7 of 9

kmiller
Collaborator
Collaborator

I can surely do my best.  Or would mind if we set up a time to do a video conference?

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 8 of 9

YuhanZhang
Autodesk
Autodesk

We logged it as INVGEN-21635 to track this issue, please provide the number to query its status.



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.

0 Likes
Message 9 of 9

kmiller
Collaborator
Collaborator

Thank you, I have been in contact with Chandra via support case and look forward to hearing more information as things are looked through and developed. 

 

Change in the API was confirmed for us and we are working on a solution to best handle our process/coding.  At this point I do not know if the change/results we found in the differences between 2018 and 2019 where intentional or not in this aspect and/or if the 2019 change will revert back to how 2018 functioned. 

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes