<?xml version="1.0" encoding="windows-1250" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>CAD F&#243;rum : permanentní přidání iLogic pravidla do dílu.</title>
  <link>https://www.cadforum.cz/forum/</link>
  <description><![CDATA[Toto je XML obsahový kanál serveru; CAD F&#243;rum : Inventor : permanentní přidání iLogic pravidla do dílu.]]></description>
  <pubDate>Sat, 25 Jul 2026 01:28:52 +0000</pubDate>
  <lastBuildDate>Mon, 28 Aug 2017 14:51:36 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.cadforum.cz/forum/RSS_post_feed.asp?TID=24746</WebWizForums:feedURL>
  <image>
   <title><![CDATA[CAD F&#243;rum]]></title>
   <url>https://www.cadforum.cz/forum/forum_images/web_wiz_forums.png</url>
   <link>https://www.cadforum.cz/forum/</link>
  </image>
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  u&#382; jsem to na&#353;el...Sub MainTrace.WriteLine(&amp;#034;Event...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108165&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108165</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=22457">Artesis</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 28.srp.2017 v 14:51<br /><br />už jsem to našel...<div>&nbsp;</div><div>Sub Main<br>Trace.WriteLine("Event Driven Rules Copy", "iLogic") 'debug </div><div>&nbsp;Dim oTemplateDoc As Document<br>&nbsp;Dim oTemplate As String <br>&nbsp;<br>&nbsp;'check file type <br>&nbsp;If ThisApplication.ActiveEditDocument.DocumentType = kDrawingDocumentObject Then<br>&nbsp;'If ThisDoc.Document.DocumentType = kDrawingDocumentObject Then<br>&nbsp;&nbsp;oTemplate = "cesta\název_šablony.idw"&nbsp;&nbsp; 'file to copy events from<br>&nbsp;ElseIf ThisApplication.ActiveEditDocument.DocumentType = kPartDocumentObject Then<br>&nbsp;'ElseIf ThisDoc.Document.DocumentType = kPartDocumentObject Then<br>&nbsp;&nbsp;oTemplate = "cesta\název_šablony.ipt"&nbsp;&nbsp; 'file to copy events from<br>&nbsp;Else<br>&nbsp;&nbsp;oTemplate = "cesta\název_šablony.iam"&nbsp;&nbsp; 'file to copy events from<br>&nbsp;End If<br>&nbsp;<br>&nbsp;'file to copy events to<br>&nbsp;oInput =&nbsp; ThisApplication.ActiveEditDocument.FullFileName <br>&nbsp;If oInput = "" Then 'catch a new file with no path<br>&nbsp;&nbsp;Return<br>&nbsp;End If&nbsp;<br>&nbsp;<br>&nbsp;'open the template<br>&nbsp;oTemplateDoc = ThisApplication.Documents.Open(oTemplate, False)<br>&nbsp;CopyEventsToDocuments(oTemplateDoc)<br>&nbsp;oTemplateDoc.Close <br>End Sub</div><div>Private Const m_ourGuid As String = "{2C540830-0723-455E-A8E2-891722EB4C3E}"<br>Private savedEnabled As Boolean<br>Dim oInput As String</div><div>Public Sub CopyEventsToDocuments(ByVal sourceDoc As Document)<br>&nbsp;Dim sourcePropSet As PropertySet = GetEventRulesPropertySet(sourceDoc)<br>&nbsp;Dim inputs() As String = { oInput} <br>&nbsp;Dim destinationFileNames As List(Of String) = New List(Of String)(inputs)<br>&nbsp;If (destinationFileNames Is Nothing) Then Return<br>&nbsp;savedEnabled = iLogicVb.Automation.RulesOnEventsEnabled<br>&nbsp;iLogicVb.Automation.RulesOnEventsEnabled = False<br>&nbsp;Try&nbsp;<br>&nbsp;&nbsp;CopyEventsToAllDocuments(sourcePropSet, sourceDoc, destinationFileNames)<br>&nbsp;Finally&nbsp;&nbsp;<br>&nbsp;&nbsp;iLogicVb.Automation.RulesOnEventsEnabled = savedEnabled<br>&nbsp;End Try</div><div>End Sub</div><div>Function GetEventRulesPropertySet(ByVal sourceDoc As Document) As PropertySet<br>&nbsp;Try<br>&nbsp;&nbsp;Return sourceDoc.PropertySets(m_ourGuid)<br>&nbsp;Catch ex As Exception<br>&nbsp;&nbsp;Return Nothing<br>&nbsp;End Try<br>End Function</div><div>Function VerifyRulesPropertySet(ByVal propSet As PropertySet) As Boolean<br>&nbsp;If (propSet Is Nothing) Then Return True<br>&nbsp;' See if any rules are internal instead of external.&nbsp; We can't copy those.<br>&nbsp;For Each prop As Inventor.Property In propSet<br>&nbsp;&nbsp;Dim strValue As String = prop.Value.ToString<br>&nbsp;&nbsp;If (Not strValue.StartsWith("file://")) Then Return False<br>&nbsp;Next<br>&nbsp;Return True<br>End Function</div><div><br>Sub CopyEventsToAllDocuments(ByVal sourcePropSet As PropertySet, ByVal sourceDoc As Document, ByVal destinationFileNames As List(Of String))<br>&nbsp;For Each fileName As String In destinationFileNames<br>&nbsp;&nbsp;If (String.Equals(sourceDoc.FullFileName, fileName)) Then Continue For<br>&nbsp;&nbsp;CopyEventsToDocument(sourcePropSet, fileName)<br>&nbsp;Next<br>End Sub</div><div>Sub CopyEventsToDocument(ByVal sourcePropSet As PropertySet, ByVal fileName As String)<br>&nbsp;'Dim doc As Document = FindOpenDocument(fileName)</div><div>&nbsp;Dim openedHere As Boolean = False</div><div>&nbsp;If (doc Is Nothing) Then<br>&nbsp;&nbsp;doc = ThisApplication.Documents.Open(fileName, True)<br>&nbsp;&nbsp;openedHere = True<br>&nbsp;End If<br>&nbsp;&nbsp;<br>&nbsp;CopyEventsPropertySetToDocument(sourcePropSet, doc)<br>&nbsp;iLogicVb.Automation.RulesOnEventsEnabled = savedEnabled</div><div>End Sub</div><div>Sub CopyEventsPropertySetToDocument(ByVal sourcePropSet As PropertySet, ByVal doc As Document)<br>&nbsp;' If an event-driven rules property set already exists, delete it.<br>&nbsp;Dim oldPropSet As PropertySet = GetEventRulesPropertySet(doc)<br>&nbsp;If (oldPropSet IsNot Nothing) Then<br>&nbsp;&nbsp;oldPropSet.Delete()<br>&nbsp;End If<br>&nbsp;If (sourcePropSet Is Nothing OrElse sourcePropSet.Count = 0) Then Return<br>&nbsp;Dim destPropSet As PropertySet = doc.PropertySets.Add("_iLogicEventsRules", m_ourGuid)<br>&nbsp;For Each prop As Inventor.Property In sourcePropSet<br>&nbsp;&nbsp;destPropSet.Add(prop.Value, prop.Name, prop.PropId)<br>&nbsp;Next<br>&nbsp;EnsureDocumentInterest(doc)<br>End Sub</div><div>Const iLogicId As String = "{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}"</div><div>Sub EnsureDocumentInterest(ByVal doc As Document)<br>&nbsp;If (ThisApplication.SoftwareVersion.Major &lt; 15) Then Return ' Inventor 2010 or before<br>&nbsp;If (DocumentHasiLogicInterest(doc)) Then Return<br>&nbsp;Dim dataVersion As Integer = 20090512<br>&nbsp;Dim newInterest As DocumentInterest = doc.DocumentInterests.Add(iLogicId, "iLogic", DocumentInterestTypeEnum.kInterested, dataVersion, Nothing)<br>End Sub</div><div>Function DocumentHasiLogicInterest(ByVal doc As Document) As Boolean<br>&nbsp;Dim interest As DocumentInterest = FindDocumentInterest(doc, iLogicId)<br>&nbsp;If (interest IsNot Nothing) Then<br>&nbsp;&nbsp;If (interest.InterestType = DocumentInterestTypeEnum.kInterested) Then<br>&nbsp;&nbsp;&nbsp;Return True<br>&nbsp;&nbsp;End If<br>&nbsp;&nbsp;interest.Delete()<br>&nbsp;End If<br>&nbsp;Return False<br>End Function</div><div>Function FindDocumentInterest(ByVal doc As Document, ByVal clientId As String) As DocumentInterest<br>&nbsp;For Each interest As DocumentInterest In doc.DocumentInterests<br>&nbsp;&nbsp;If (String.Equals(interest.ClientId, clientId, StringComparison.OrdinalIgnoreCase)) Then<br>&nbsp;&nbsp;&nbsp;Return interest<br>&nbsp;&nbsp;End If<br>&nbsp;Next<br>&nbsp;Return Nothing<br>End Function</div>]]>
   </description>
   <pubDate>Mon, 28 Aug 2017 14:51:36 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108165&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108165</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  Kdysi existovala aplikace Code...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108163&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108163</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=9996">Navara</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 28.srp.2017 v 08:08<br /><br />Kdysi existovala aplikace Code Injector, která tohle uměla, ale stejně doporučuju se spíš podívat na to, jak nastavit externí pravidlo pro X-Tools a jak ho spouštět. Pokud byste potřeboval pomoci s nastavením XTools, tak se obraťte na helpdesk.]]>
   </description>
   <pubDate>Mon, 28 Aug 2017 08:08:58 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108163&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108163</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  M&#283; osobn&#283; by sta&#269;ilo, aby se...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108162&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108162</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=22457">Artesis</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 28.srp.2017 v 07:20<br /><br />Mě osobně by stačilo, aby se to zahrnulo pomocí jednoho exterího&nbsp;pravidla&nbsp;do - pravidel po spuštění - před uložením dokumentu - "dané pravidlo". Tudíž jakékoliv vypínání-zapínání by do budoucna nemělo dělat problémy. Nejde o žádné stovky pravidel. Jde jen o jedno jediné pravidlo a to pro rozvin. Ostatní si před globální formuláře pouze spouštím, není třeba aby byly adaptivní tak jako pravidlo pro rozvin.]]>
   </description>
   <pubDate>Mon, 28 Aug 2017 07:20:46 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108162&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108162</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  Co t&#345;eba zp&#283;tn&#225; aktualizace?...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108146&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108146</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=9996">Navara</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 25.srp.2017 v 12:33<br /><br />Co třeba zpětná aktualizace? Dočasné, nebo trvalé vypnutí?<div>Tohle vede na to, že budete mít ten kód na desítkách až stovkách různých míst a pokud budete chtít cokoli změnit, tak to bude prakticky neproveditelné.</div>]]>
   </description>
   <pubDate>Fri, 25 Aug 2017 12:33:27 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108146&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108146</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  z jak&#233;ho d&#367;voduje to &#353;patn&#225;...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108138&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108138</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=22457">Artesis</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 25.srp.2017 v 10:38<br /><br />z jakého důvodu&nbsp;je to špatná cesta?]]>
   </description>
   <pubDate>Fri, 25 Aug 2017 10:38:45 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108138&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108138</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  Tohle nen&#237; dobr&#225; cesta. Doporu&#269;uju...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108120&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108120</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=9996">Navara</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 24.srp.2017 v 14:31<br /><br />Tohle není dobrá cesta. Doporučuju použít externí pravidlo a spouštět ho pomocí X-Tools]]>
   </description>
   <pubDate>Thu, 24 Aug 2017 14:31:52 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108120&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108120</guid>
  </item> 
  <item>
   <title><![CDATA[permanentní přidání iLogic pravidla do dílu. :  Dobr&#253; den, je n&#283;jak&#225; mo&#382;nost...]]></title>
   <link>https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108119&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108119</link>
   <description>
    <![CDATA[<strong>Autor:</strong> <a href="https://www.cadforum.cz/forum/member_profile.asp?PF=22457">Artesis</a><br /><strong>Předmět:</strong> 24746<br /><strong>Zasláno:</strong> 24.srp.2017 v 13:58<br /><br />Dobrý den,<div>&nbsp;</div><div>&nbsp; je nějaká možnost přidat pomocí jednoho iLogic pravidla permanentně pravidlo např. pro rozvin do dílu (ipt. souboru)?</div><div>U nových dílů nemám problém, pravidlo mám v šabloně. Pro staré díly, kde toto pravidlo není aktivováno&nbsp;je to přes spuštěče událostí&nbsp;pomalé, hlavně u většího počtu dílů. Člověku prostě trvá než se prokliká nabídkou...</div><div>Měl bych představu, že bych poté dané pravidlo zahrnul do globálních formulářů a na jedno kliknutí by se rozvin natrvalo v díle aktivoval.</div><div>&nbsp;</div><div>(funkční pravidlo pro rozvin mám)</div><div>&nbsp;</div><div>Díky za rady.</div><span style="font-size:10px"><br /><br />Upravil Artesis - 24.srp.2017 v 14:04</span>]]>
   </description>
   <pubDate>Thu, 24 Aug 2017 13:58:41 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum/forum_posts.asp?TID=24746&amp;PID=108119&amp;title=permanentni-pridani-ilogic-pravidla-do-dilu#108119</guid>
  </item> 
 </channel>
</rss>