<?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>tema Feature creation in API en FeatureCAM Forum</title>
    <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8032352#M2950</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very new to using the API in FeatureCAM. I tried creating Features with dimensions such as&amp;nbsp;Pocket, Hole and they work fine. I'm figuring out how to create Features using curves. The API help mentions that curves must be defined as Variant. What does that mean and how do I define the curves?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a very simple code that I tired, but it doesn't work for AddPocket. If I give the exact name of the curve in " " - it works.&lt;/P&gt;&lt;P&gt;For e.g. &lt;EM&gt;doc.Features.AddPocket("curve12', 6)&lt;/EM&gt; -- This works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the curve names will differ and also there&amp;nbsp;can be multiple curves in a project. So how do I define it in the macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main

	Dim doc As FMDocument
	Set doc = Application.ActiveDocument

	doc.Features.AddRectPocket(100, 50, 5)

	doc.Features.AddPocket("???", 6)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 14:07:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-05-29T14:07:24Z</dc:date>
    <item>
      <title>Feature creation in API</title>
      <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8032352#M2950</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very new to using the API in FeatureCAM. I tried creating Features with dimensions such as&amp;nbsp;Pocket, Hole and they work fine. I'm figuring out how to create Features using curves. The API help mentions that curves must be defined as Variant. What does that mean and how do I define the curves?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a very simple code that I tired, but it doesn't work for AddPocket. If I give the exact name of the curve in " " - it works.&lt;/P&gt;&lt;P&gt;For e.g. &lt;EM&gt;doc.Features.AddPocket("curve12', 6)&lt;/EM&gt; -- This works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the curve names will differ and also there&amp;nbsp;can be multiple curves in a project. So how do I define it in the macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main

	Dim doc As FMDocument
	Set doc = Application.ActiveDocument

	doc.Features.AddRectPocket(100, 50, 5)

	doc.Features.AddPocket("???", 6)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 14:07:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8032352#M2950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-29T14:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Feature creation in API</title>
      <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8038909#M2966</link>
      <description>&lt;P&gt;A Variant type means it can be one thing or another (typically two choices, sometimes N!)&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, you can either pass the name of a curve, or the curve itself.&amp;nbsp; For instance, if you make a curve like:&lt;/P&gt;&lt;P&gt;Dim resultCurve As IFMCurve&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Set resultCurve = curvePtList.AddCurveFromPtList(False)&lt;/P&gt;&lt;P&gt;' then you can pass the IFMCurve to the pocket&lt;/P&gt;&lt;P&gt;doc.Features.AddPocket(resultCurve, ...)&lt;/P&gt;&lt;P&gt;' or you can do as you do above, and pass the string name of the curve, as in,&lt;/P&gt;&lt;P&gt;doc.Features.AddPocket(resultCurve.Name, ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 18:05:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8038909#M2966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-31T18:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Feature creation in API</title>
      <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8042694#M2980</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the information. I tried your method and&amp;nbsp;it works great. But this creates a curve based on Point list pattern.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I need to pass some of the&amp;nbsp;existent curves in the document? (for e.g. in the below pic, I've got 3 curves in the document already and I need to create a Pocket feature from only 2 of those). Can these be passed by names or selection?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using multiple names -&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;doc.Features.AddPocket("curve1, curve3", ...&lt;/EM&gt; - but that doesn't work. It only takes one curve name at a time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cc.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/507781iBCA31D4A2B9083CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cc.png" alt="cc.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2018 14:00:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8042694#M2980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-02T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Feature creation in API</title>
      <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8045086#M2988</link>
      <description>&lt;P&gt;if you wish to create two pockets out of two curves, call it twice - once for each curve.&amp;nbsp; If you wish to create one pocket from two curves, there are different variations for the VARIANT&amp;nbsp;that are also useful.&lt;/P&gt;&lt;P&gt;you passed it one string (which it thought was the one name of one curve) - the variant that works in that case is a string array. E.g.,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Dim crvArray(2) As String&lt;BR /&gt;&amp;nbsp; &amp;nbsp;crvArray(1) = "crv1"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;crvArray(2) = "crv4"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Dim fmdc As FMDocument&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set fmdc = Application.ActiveDocument&lt;BR /&gt;&amp;nbsp; &amp;nbsp;fmdc.Features.AddPocket( crvArray, 1 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you could also make a pocket from whatever curve(s) is/are selected by saying:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;fmdc.Features.AddPocket( fmdc.Selected , 1 )&amp;nbsp; ' get the selected set and pass it to AddPocket.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;if something nonsensical is selected, then addPocket should return Nothing, but you can select N curves and it will make a pocket out of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 14:47:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8045086#M2988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-04T14:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Feature creation in API</title>
      <link>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8047462#M3003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very useful information. I tried what you mentioned and it works great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for all your help.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 12:47:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/featurecam-forum/feature-creation-in-api/m-p/8047462#M3003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-05T12:47:16Z</dc:date>
    </item>
  </channel>
</rss>

