<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: UpdateFromGlobal style crashes in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466562#M147625</link>
    <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I'm not sure what could be going wrong. Try opening &lt;BR /&gt;
the drawing visible to see if that makes a difference (there are some known &lt;BR /&gt;
issues working with invisible drawing documents).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Apr 2009 18:12:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-04-14T18:12:08Z</dc:date>
    <item>
      <title>UpdateFromGlobal style crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466559#M147622</link>
      <description>I am trying to update styles that are not up to date by using the UpdateFromGlobal method, but Inventor crashes with catastrophic failure and closes.  &lt;BR /&gt;
&lt;BR /&gt;
What I do is loop through all styles from DrawingStylesManager and check the UpToDate property. If the style is not up to date I call the UpdateFromGlobal method. &lt;BR /&gt;
&lt;BR /&gt;
What's wrong with this?</description>
      <pubDate>Mon, 13 Apr 2009 07:14:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466559#M147622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-13T07:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateFromGlobal style crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466560#M147623</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;You need to add a check to see whether the style &lt;BR /&gt;
exists locally as well as in the library. The 'UpdateFromGlobal' call makes &lt;BR /&gt;
sense only for such styles. The code should look like this:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sub UpdateFromGlobal()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As DrawingDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &lt;BR /&gt;
oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oStyle As Style&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oStyle &lt;BR /&gt;
In oDoc.StylesManager.Styles&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oStyle.StyleLocation = &lt;BR /&gt;
kBothStyleLocation &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
Not oStyle.UpToDate &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
oStyle.UpdateFromGlobal&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End &lt;BR /&gt;
If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Apr 2009 19:06:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466560#M147623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-13T19:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateFromGlobal style crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466561#M147624</link>
      <description>Thanks for answering. I was doing exactly as you said before - checking if the style needs updating and if the location equals kBothStyleLocation. It still crashes on any kind of drawing style that needs updating. The error that I get is:&lt;BR /&gt;
&lt;BR /&gt;
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))&lt;BR /&gt;
&lt;BR /&gt;
and it happens only on drawing styles and most of all causes Inventor to close immediately.  I really can not see what I am doing wrong. &lt;BR /&gt;
&lt;BR /&gt;
As additional info I am opening drawings in hidden mode and I am using C# to write my add-in.</description>
      <pubDate>Tue, 14 Apr 2009 06:27:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466561#M147624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-14T06:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateFromGlobal style crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466562#M147625</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I'm not sure what could be going wrong. Try opening &lt;BR /&gt;
the drawing visible to see if that makes a difference (there are some known &lt;BR /&gt;
issues working with invisible drawing documents).&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Apr 2009 18:12:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466562#M147625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-14T18:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateFromGlobal style crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466563#M147626</link>
      <description>Seems like when document opened visible the UpdateFromGlobal works fine. Hmm ... i really needed for the document to be invisible. &lt;BR /&gt;
&lt;BR /&gt;
As I see the Style&amp;amp;Standard support in API is really limited; maybe Autodesk will think about improving this in a later version.</description>
      <pubDate>Wed, 15 Apr 2009 06:37:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/updatefromglobal-style-crashes/m-p/2466563#M147626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-15T06:37:44Z</dc:date>
    </item>
  </channel>
</rss>

