<?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: VBA: insert content center pipe with custom length in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6431427#M65415</link>
    <description>&lt;P&gt;Hi. Trying to learn to fish for a day, I see!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how you learn to fish for a lifetime:&lt;/P&gt;
&lt;P&gt;1. Go/Find the file below on your computer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "C:\Program Files\Autodesk\Inventor 2016\Local Help\admapi_20_0.chm"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Open it, to the index tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Search for "Content Center"&lt;/P&gt;
&lt;P&gt;4. Navigate through the tree until you find your answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found it in all of 10 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2016 14:14:09 GMT</pubDate>
    <dc:creator>MechMachineMan</dc:creator>
    <dc:date>2016-07-12T14:14:09Z</dc:date>
    <item>
      <title>VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6423578#M65306</link>
      <description>&lt;P&gt;He guys and girls.&lt;/P&gt;&lt;P&gt;2 questions in this post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;I have been reading alot but nothing realy helps my problem.&lt;/P&gt;&lt;P&gt;We have in our firm our pipes wich are in the content centre. The pipes are selectable with fixed diameters, and length can be anything.&lt;/P&gt;&lt;P&gt;See screenshot.&lt;/P&gt;&lt;P&gt;&lt;IMG title="2016-07-07_14h58_26.png" alt="2016-07-07_14h58_26.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/253342i7E8260CC72A52A67/image-size/medium?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;I use : family.CreateMember(4, failureReason, failureMessage, kRefreshOutOfDateParts, False)&lt;/P&gt;&lt;P&gt;wich in this case row 4 is&amp;nbsp;Ø80, to insert the pipe later on.&lt;/P&gt;&lt;P&gt;My question is how do I specify the Length parameter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have the parts be standard content centre parts. A coworker has made this macro and inserts the pipe as a custom part, and then changes the custom property to the value measured before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;But I would still like to be able to use the content centre&amp;nbsp;"change size" command afterwards if needed.&lt;/P&gt;&lt;P&gt;Wich is my second question because I can't find anything about that. Once the pipe is placed I would like to be able to measure again and have the pipe change automaticly. Not replace with a new custom part but in the same way the content centre does.&lt;/P&gt;&lt;P&gt;I have no idea what the command is in VBA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6423578#M65306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-07T13:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6431141#M65410</link>
      <description>&lt;P&gt;Mmmm didn't think it would be that difficult.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Nobody with an idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 12:23:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6431141#M65410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-12T12:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6431427#M65415</link>
      <description>&lt;P&gt;Hi. Trying to learn to fish for a day, I see!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how you learn to fish for a lifetime:&lt;/P&gt;
&lt;P&gt;1. Go/Find the file below on your computer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "C:\Program Files\Autodesk\Inventor 2016\Local Help\admapi_20_0.chm"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Open it, to the index tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Search for "Content Center"&lt;/P&gt;
&lt;P&gt;4. Navigate through the tree until you find your answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found it in all of 10 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 14:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6431427#M65415</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2016-07-12T14:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6432332#M65431</link>
      <description>&lt;P&gt;Wow you must be&amp;nbsp;like really smart&amp;nbsp;because I have been looking for the answer for 3 days and couldn't find it.&lt;/P&gt;&lt;P&gt;I'm just a simple Inventor user making his own macro's from tutorials I find online and need&amp;nbsp;some help because I obviously missed something in trying to educate myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what I lack in brains I make up in good manners.&lt;/P&gt;&lt;P&gt;Thank you very much for the push in the correct direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ow, and I don't understand a single thing about the fishing. Must be my low IQ again, sorry.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 19:45:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6432332#M65431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-12T19:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6474750#M65813</link>
      <description>&lt;P&gt;Nice manners. They go well with that snarky attitude.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/259992iDEFB37C549A389E5/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="ClickThisFirst.PNG" title="ClickThisFirst.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2: "What is a NameValueMap?"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/259993i0A9AB7C6A3295840/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="ClickThisSecond.PNG" title="ClickThisSecond.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/259994i22118F7981DCE064/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="ClickThisThird.PNG" title="ClickThisThird.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this will be the name value map. (I'm writing this in vb.net, whereas almost all of the samples use vba, and vb.net is what is used in the rule environment)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;oSomeCustomLength = "24 in"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oNVM As NameValueMap&lt;/P&gt;
&lt;P&gt;oNVM = ThisApplication.TransientObjects.CreateNameValueMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;oNVM.Value("LengthParamColumnNameFromContentCenterEditor") = oSomeCustomLength&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To finish off, insert it back into the CreateFamilyMember line as the optional parameter that it is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 04:30:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/6474750#M65813</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2016-08-03T04:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: insert content center pipe with custom length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/10694741#M130202</link>
      <description>&lt;P&gt;This github library makes it easy to work with content center and assemblies&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/HYMMA/InventorToolBox" target="_blank" rel="noopener"&gt;https://github.com/HYMMA/InventorToolBox&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//connect to inventor
var app = App.Start();

//generate file name
var partName = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "PartFileName.ipt");
var assyName =System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "AssemblyFileName.iam");
PartDocument part;
AssemblyDocument assembly;
//make a new part document or open it if already exists
            try
            {
                part = app.NewPart(partName);
            }
            catch (Exception)
            {
                part = app.Open(partName, false) as PartDocument;
            }

            //make a new assembly document or open it if already exists
            try
            {
                assembly = app.NewAssembly(assyName);
            }
            catch (Exception)
            {
                assembly = app.Open(assyName) as AssemblyDocument;
            }

//set the part number proprety of the part
part.AsDocument().SetProperty(kDocumnetProperty.PartNumber, "S/S6758");

//add the part that was created to the assembly
var partOccurance = assembly.AddMemeber(part.AsDocument(), new[] { 0d, 0d, 1d }, new[] { 10d, 10d, 0d });

var contentCenterDesc = new ContentCenterItemDescriptor(row: 3, "Structural Shapes", "Angles", "BS 4848"){ CustomValue = new KeyValuePair&amp;lt;string, object&amp;gt;("B_L", 658) };

var contentCenterOccurance = assembly.AddMemeber(contentCenterDesc, new[] { 0d, 0d, 1d }, new[] { 10d, 10d, 0d });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 06:08:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-insert-content-center-pipe-with-custom-length/m-p/10694741#M130202</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-18T06:08:02Z</dc:date>
    </item>
  </channel>
</rss>

