<?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: Programatically SAVE File with concatenated Property Set data in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8635423#M10656</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2458525"&gt;@Jowennl&lt;/a&gt; this works exactly as I hoped it would and automates a tedious process and it should hopefully eliminate manual errors...!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I went a step further and added a right click command for BUSAVE....:)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" style="width: 329px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/609697i9A037469D5D13802/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" alt="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2019 19:23:11 GMT</pubDate>
    <dc:creator>neilyj666</dc:creator>
    <dc:date>2019-03-04T19:23:11Z</dc:date>
    <item>
      <title>Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8367764#M10648</link>
      <description>&lt;P&gt;I have created Property Set data to add my files as metadata as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-10-30 07_41_59-Autodesk Civil 3D 2019 - [Drawing1.dwg].jpg" style="width: 418px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563322i0B832DAB645CDA21/image-dimensions/418x324?v=v2" width="418" height="324" role="button" title="2018-10-30 07_41_59-Autodesk Civil 3D 2019 - [Drawing1.dwg].jpg" alt="2018-10-30 07_41_59-Autodesk Civil 3D 2019 - [Drawing1.dwg].jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I progress my design I type SAVE on the command line and append the name with _SuitabilityCode_RevisionCode as shown below. The "live" drawing will always end with a 4 digit number so as per screenshot my current file will next be SAVEd as P01.04 and I manually increment the Revision on my 0001 drawing to P01.05.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-10-30 07_59_19-CHD_Crane Hardstands.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563323iE394A4EB3861409A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-10-30 07_59_19-CHD_Crane Hardstands.jpg" alt="2018-10-30 07_59_19-CHD_Crane Hardstands.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would like to automate this such that the Suitability code and Revision get added as part of the SAVE but I have no idea if this is possible or indeed how to achieve it. I have done a similar thing for Excel files via VBA which works fairly well but AutoCAD programming is a mysterious art...!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone advise and hopefully post up some code to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 08:11:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8367764#M10648</guid>
      <dc:creator>neilyj666</dc:creator>
      <dc:date>2018-10-30T08:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391150#M10649</link>
      <description>&lt;P&gt;One idea is to create a simple .NET project with a command having following workflow:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1) Read the required custom property value of current active drawing( to which custom properites are already set) &lt;BR /&gt;2) 'SAVEAS' the current drawing, appending the custom property values to the current drawing name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample code that can be helpful to implement the workflow:&lt;/P&gt;
&lt;PRE&gt;[CommandMethod("saveDwgWithNewName")]
public static void saveDwgWithNewName()
{
    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
    Document doc = ed.Document;
    Database db = doc.Database;
    // get the name of the current drawing without extension
    string curDwgName = Path.GetFileNameWithoutExtension(doc.Name);
    try
    {
        DatabaseSummaryInfoBuilder sumInfo = new DatabaseSummaryInfoBuilder(db.SummaryInfo);
        IDictionary custProps = sumInfo.CustomPropertyTable;
        // get the custom property value  
        string custProp = (string)custProps["SuitabilityCode"];
        if (custProp != null)
        {
            //append custom property name to current drawing name  
            string newDwgName = curDwgName + "_" + custProp;
            // save current drawing with new name 
            doc.Database.SaveAs(newDwgName, true, DwgVersion.Current, doc.Database.SecurityParameters);
        }
    }
    catch (System.Exception ex)
    {
        ed.WriteMessage(ex.ToString());
    }
}
&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Setting up a .NET Project for Autodesk Civil 3D can be helpful reference to use the above code :&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/CIV3D/2019/ENU/?guid=GUID-DE3A46DA-508E-43A0-8538-C77D978D06B2" target="_blank"&gt;https://help.autodesk.com/view/CIV3D/2019/ENU/?guid=GUID-DE3A46DA-508E-43A0-8538-C77D978D06B2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 10:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391150#M10649</guid>
      <dc:creator>deepak.a.s.nadig</dc:creator>
      <dc:date>2018-11-09T10:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391714#M10650</link>
      <description>&lt;P&gt;Firstly, since you are post in Civil3D forum, "Property Set" has its own meanings in Civil3D/AutoCAD Arch, while your question is about drawing custom properties, which is applicable to all AutoCAD based products.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your issue is to synchronize the custom properties and file name. The way to do it depends on the work flow: change the custom property first, and then make sure the file name is changed accordingly with "SaveAs"; or user simply save the file to whatever name needed, and the custom properties in drawing is automatically updated accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both AutoCAD VBA and AutoCAD .NET API can be used to do it fairly easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code provided by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3806531"&gt;@deepak.a.s.nadig&lt;/a&gt;&amp;nbsp;uses the first approach, where user has to change the custom property, and use the custom command to save the file (user has to remember no use built-in SaveAs command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be more natural just allow user to "SaveAs" the drawing as needed/required and the custom property in drawing gets updated automatically when SaveAs occurs. You only need to write code to catch the event when saving is to begin. At that moment, the code would compare the file name to be saved with the custom property and update the custom property when necessary. The actual saving would happen after the code done its work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, you need to be able to write code in VBA, or preferably, in .NET API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 14:30:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391714#M10650</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2018-11-09T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391834#M10651</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; - you are correct; it is the custom property that I have created rather than Property Set data. I do a Save (rather than a Save As) so that I can keep working on the original drawing whilst the ones with an _S0_PXX.XX suffix are archive copies.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3806531"&gt;@deepak.a.s.nadig&lt;/a&gt; as I have no skill with either VBA or .NET it looks like I'll just continue to do this manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neil&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 15:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8391834#M10651</guid>
      <dc:creator>neilyj666</dc:creator>
      <dc:date>2018-11-09T15:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8603057#M10652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/507254"&gt;@neilyj666&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about a simple Lisp routine? See animated gif below and attached lisp.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DWGPROS - BUSAVE LISP.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/604214iD6292B1A90C57C23/image-size/large?v=v2&amp;amp;px=999" role="button" title="DWGPROS - BUSAVE LISP.gif" alt="DWGPROS - BUSAVE LISP.gif" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;DWGPROS - BUSAVE LISP.gif&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Jowenn&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 15:01:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8603057#M10652</guid>
      <dc:creator>Jowennl</dc:creator>
      <dc:date>2019-02-18T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8634879#M10655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/507254"&gt;@neilyj666&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see this &lt;A href="https://knowledge.autodesk.com/community/screencast/9374a568-0895-4ba7-b63b-9b2a720d8102" target="_blank" rel="noopener"&gt;&amp;lt;Screencast Link&amp;gt;&lt;/A&gt; and ShareRoutine.zip below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Jowenn&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 15:57:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8634879#M10655</guid>
      <dc:creator>Jowennl</dc:creator>
      <dc:date>2019-03-04T15:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically SAVE File with concatenated Property Set data</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8635423#M10656</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2458525"&gt;@Jowennl&lt;/a&gt; this works exactly as I hoped it would and automates a tedious process and it should hopefully eliminate manual errors...!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I went a step further and added a right click command for BUSAVE....:)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" style="width: 329px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/609697i9A037469D5D13802/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" alt="2019-03-04 19_15_04-Autodesk Civil 3D 2019 - RtClick.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 19:23:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/programatically-save-file-with-concatenated-property-set-data/m-p/8635423#M10656</guid>
      <dc:creator>neilyj666</dc:creator>
      <dc:date>2019-03-04T19:23:11Z</dc:date>
    </item>
  </channel>
</rss>

