<?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 iLogic script to calculate number of specific kCustomLineType in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295369#M89300</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a chance to calculate, in the sketch, number of curves with a special line type i.e.: "ACAD_ISO02W100"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below iLogic script I'm able to calculate all the curves with "kCustomLineType", but I need to know how many lines are with above given type...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sketch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(1)

&lt;SPAN style="color: #808080;"&gt;'Dim linesCount As Integer &lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; = 0 &lt;SPAN style="color: #808080;"&gt;' ******* must be a parameter *******&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #ff0000;"&gt;To&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SketchLines&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Count&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SketchLines&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;LineType&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"kCustomLineType"&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;' "ACAD_ISO02W100" needed&lt;/SPAN&gt;
            &lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; + 1
        &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 20:51:35 GMT</pubDate>
    <dc:creator>mallorn</dc:creator>
    <dc:date>2018-09-26T20:51:35Z</dc:date>
    <item>
      <title>iLogic script to calculate number of specific kCustomLineType</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295369#M89300</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a chance to calculate, in the sketch, number of curves with a special line type i.e.: "ACAD_ISO02W100"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below iLogic script I'm able to calculate all the curves with "kCustomLineType", but I need to know how many lines are with above given type...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sketch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(1)

&lt;SPAN style="color: #808080;"&gt;'Dim linesCount As Integer &lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; = 0 &lt;SPAN style="color: #808080;"&gt;' ******* must be a parameter *******&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #ff0000;"&gt;To&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SketchLines&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Count&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SketchLines&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;LineType&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"kCustomLineType"&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;' "ACAD_ISO02W100" needed&lt;/SPAN&gt;
            &lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;linesCount&lt;/SPAN&gt; + 1
        &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 20:51:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295369#M89300</guid>
      <dc:creator>mallorn</dc:creator>
      <dc:date>2018-09-26T20:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic script to calculate number of specific kCustomLineType</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295967#M89321</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1681227"&gt;@mallorn&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide Inventor file which contains custom line (ACAD_ISO02W100) to test?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make sure that files are non confidential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 06:30:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295967#M89321</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-09-27T06:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic script to calculate number of specific kCustomLineType</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295996#M89323</link>
      <description>&lt;P&gt;No problem,&lt;/P&gt;&lt;P&gt;You can get the custom line types directly from Inventor standard database also (right clicking on curve properties):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ACAD_ISO02W100.png" style="width: 382px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/550973i0D00C20156F6C1AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ACAD_ISO02W100.png" alt="ACAD_ISO02W100.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 06:43:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8295996#M89323</guid>
      <dc:creator>mallorn</dc:creator>
      <dc:date>2018-09-27T06:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic script to calculate number of specific kCustomLineType</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8296216#M89328</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1681227"&gt;@mallorn&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to count number of custom line type ("ACAD_ISO02W100").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSketch As Sketch
oSketch = oDoc.ComponentDefinition.Sketches.Item(1)

'Dim linesCount As Integer 
linesCount = 0 ' ******* must be a parameter *******
Dim oName As String 
Dim oDesc As String
Dim i As Double
For i = 1 To oSketch.SketchLines.Count
    If oSketch.SketchLines.Item(i).LineType.ToString = "kCustomLineType" ' "ACAD_ISO02W100" needed
	   
	   Call oSketch.SketchLines.Item(i).GetCustomLineType(oName, oDesc)
	   
	   If oName = "ACAD_ISO02W100" Then
	   		linesCount = linesCount + 1
	   End If  		   
    End If
Next i&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 08:57:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-script-to-calculate-number-of-specific-kcustomlinetype/m-p/8296216#M89328</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-09-27T08:57:10Z</dc:date>
    </item>
  </channel>
</rss>

