<?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: If symbol &amp;quot;XX&amp;quot; exist on drawing then... in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10966777#M134925</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_self"&gt;&lt;SPAN class=""&gt;WCrihfield&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. I manage to solve the problem with help of your program to find out if the symbol exist in the drawingtemplate. Then I used "If oMySSDef.IsReferenced = True " to find if there where any symbols placed on the drawings sheets. Seems to work.&lt;/P&gt;&lt;P&gt;BR/Goran&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 08:36:11 GMT</pubDate>
    <dc:creator>Gwennberg</dc:creator>
    <dc:date>2022-02-23T08:36:11Z</dc:date>
    <item>
      <title>If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963006#M134829</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I would like to activate a script if a specific symbol exist on the drawing. First I need to check that the symbol exist in the library because old drawingtemplates do not have the symbol.&lt;/P&gt;&lt;P&gt;BR/Goran&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 15:19:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963006#M134829</guid>
      <dc:creator>Gwennberg</dc:creator>
      <dc:date>2022-02-21T15:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963213#M134838</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1032629"&gt;@Gwennberg&lt;/a&gt;.&amp;nbsp; Can you include more details about what you want and are trying to accomplish overall.&amp;nbsp; What specifically do you mean by "activate a script"?&amp;nbsp; By symbol, are we talking about a &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-B201EE56-8BBB-470A-BCC0-408960E48EFB" target="_blank" rel="noopener"&gt;SketchedSymbolDefinition&lt;/A&gt; object here, or something else?&amp;nbsp; If you just want the code to check if this 'symbol' exists within a drawing document, then why would we also need to know if it exists in some external library?&amp;nbsp; What do you want to do with the symbol if it is found?&amp;nbsp; What do you want to happen if it is not found?&amp;nbsp; If it is found, do you want to delete any instances (&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-FE8D1453-8F41-4CCE-B7E6-8DDB3653FAA0" target="_blank" rel="noopener"&gt;SketchedSymbol&lt;/A&gt; objects) of it that have been placed on any of the drawings sheets?&amp;nbsp; Do you want to replace existing ones, instead of delete them?&lt;/P&gt;
&lt;P&gt;Here is something that may give you a head start if some of my assumptions are correct:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule to work. Exiting.", vbCritical, "iLogic")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisApplication.ActiveDocument
oSSDefs = oDDoc.SketchedSymbolDefinitions
Dim oMySSDef As SketchedSymbolDefinition = Nothing
If oSSDefs.Count &amp;gt; 0 Then
	For Each oSSDef As SketchedSymbolDefinition In oSSDefs
		If oSSDef.Name = "XX" Then
			oMySSDef = oSSDef
		End If
	Next
End If
If oMySSDef Is Nothing Then
	MsgBox("It was Not Found.",,"")
	'could ask user if they want to import it from library
	'oLib = oSSDefs.SketchedSymbolDefinitionLibraries.Item(1)
	'oMySSDef = oSSDefs.AddFromLibrary(oLib, "XX", False)
Else 'it was found, so replace it from library source
	MsgBox("It was Found.",,"")
	'message user, say it was found, ask if they want to replace it from library
	'oLib = oSSDefs.SketchedSymbolDefinitionLibraries.Item(1)
	'oMySSDef = oSSDefs.AddFromLibrary(oLib, "XX", True)
End If&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Feb 2022 17:18:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963213#M134838</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-02-21T17:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963373#M134847</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_self"&gt;&lt;SPAN class=""&gt;WCrihfield, thanks for your answer&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Today I have a ilogic script that makes a pdf-file of the manufacture drawing. Now we need a control drawing there we can put out symbols which measure our staff should check then the parts arrive. So I would like to make two different drawings (pdf-files); one for manufacturing and one for control.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;My idea to solve this, is that I make a specific symbol on a unique layer. This symbol will be places on those measures we will control. My script will first hide the symbols and generate a manufacturing drawing and then light up and make the control pdf.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;The new symbol will only exist in a new drawing template and on some drawing the symbol might not be placed so I need a check in the script that the template is new and that the symbol has been placed. Sounds OK?!?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;//Goran&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 19:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10963373#M134847</guid>
      <dc:creator>Gwennberg</dc:creator>
      <dc:date>2022-02-21T19:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10964272#M134863</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is it possible to check if the symbol exist on the drawing area (has been used)?&lt;/P&gt;&lt;P&gt;BR/Goran&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 07:44:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10964272#M134863</guid>
      <dc:creator>Gwennberg</dc:creator>
      <dc:date>2022-02-22T07:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10965426#M134889</link>
      <description>&lt;P&gt;The short answer to your last question is yes.&lt;/P&gt;
&lt;P&gt;If 'instances' (&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-FE8D1453-8F41-4CCE-B7E6-8DDB3653FAA0" target="_blank" rel="noopener"&gt;SketchedSymbol&lt;/A&gt; objects) of the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-B201EE56-8BBB-470A-BCC0-408960E48EFB" target="_blank" rel="noopener"&gt;SketchedSymbolDefinition&lt;/A&gt; have been placed on any of the drawing's sheets, you can find them by looping through each &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-7BCBBA98-FFBE-45CD-AEEE-00FFD9AC4AEA" target="_blank" rel="noopener"&gt;Sheet&lt;/A&gt;, and checking the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-3B4D31E5-036B-4BDC-A237-39528F346048" target="_blank" rel="noopener"&gt;Sheet.SketchedSymbols.Count&lt;/A&gt; first, to see if there area any &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-7EB2F552-E264-4B2B-8088-6B56E0DFE00B" target="_blank" rel="noopener"&gt;SketchedSymbols&lt;/A&gt; on the sheet, then if there are, you can check further by loop through each &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-FE8D1453-8F41-4CCE-B7E6-8DDB3653FAA0" target="_blank" rel="noopener"&gt;SketchedSymbol&lt;/A&gt; object in the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-3B4D31E5-036B-4BDC-A237-39528F346048" target="_blank" rel="noopener"&gt;Sheet.SketchedSymbols&lt;/A&gt; collection, checking to see if its &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-2C902AE4-3893-4791-9BBA-205DD1868B41" target="_blank" rel="noopener"&gt;SketchedSymbol.Definition property&lt;/A&gt; points to the specific SketchedSymbolDefinition you are working with.&amp;nbsp; Does that make sense to you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To implement this, I would put the code for this part after you have already searched for and found (or copied over) the main SketchedSymbolDefinition object you were initially looking for.&amp;nbsp; If you did not find the definition object, you will not find any instances, so no need to proceed to look for them.&amp;nbsp; If the definition was found, then you can proceed to check for placed instances of it using that definition object to compare against any 'instances' of it that may have been placed on any sheets, as mentioned above.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:31:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10965426#M134889</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-02-22T16:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: If symbol "XX" exist on drawing then...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10966777#M134925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_self"&gt;&lt;SPAN class=""&gt;WCrihfield&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. I manage to solve the problem with help of your program to find out if the symbol exist in the drawingtemplate. Then I used "If oMySSDef.IsReferenced = True " to find if there where any symbols placed on the drawings sheets. Seems to work.&lt;/P&gt;&lt;P&gt;BR/Goran&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 08:36:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/if-symbol-quot-xx-quot-exist-on-drawing-then/m-p/10966777#M134925</guid>
      <dc:creator>Gwennberg</dc:creator>
      <dc:date>2022-02-23T08:36:11Z</dc:date>
    </item>
  </channel>
</rss>

