<?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: lISP to edit survey figure style. in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910562#M3749</link>
    <description>&lt;P&gt;Hosneyalaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially I would like to be able to switch the styles between these two states with quick command.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STATE 1.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1204801iAB3A3879CEB2FB3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STATE 1.JPG" alt="STATE 1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STATE 2.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1204802i80CAE50F607F36F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STATE 2.JPG" alt="STATE 2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The inspiration for this was a lisp routine I found which will toggle on the display of triangles in a civil 3D surface.&amp;nbsp; Which is the toggle triangles lisp I have attached.&amp;nbsp; Using that as a template I am able to get to the point where I can use the code below to select as survey figure, then have it perform an action to change the style.&amp;nbsp; At this point I am struggling with defining the action.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(vl-load-com)

(defun c:SF2D () (c:SurveyFigure2D))
(defun c:SurveyFigure2D (/ *error* acDoc obj)

(defun *error* (msg)
(if ss
(vla-delete ss)
)
(if acDoc
(vla-endundomark acDoc)
)
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; &amp;lt;esc&amp;gt; or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)

(if (ssget '((0 . "AECC_SVFIGURE*")))
(
; need code to change survey figure style from 3D to 2D here.
)

; Original surface style change is commented out below.
;(progn
; (vla-startundomark
; (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
; )
; (vlax-for x (setq ss (vla-get-activeselectionset acDoc))
; (vlax-put
; (setq obj
; (vlax-get (vlax-get (vlax-get x 'style) 'trianglestyle)
; 'displaystyleplan
; )
; )
; 'visible
; (1- (abs (vlax-get obj 'visible)))
; )
; )
;)
)

(*error* nil)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 17:48:02 GMT</pubDate>
    <dc:creator>cody.faltin</dc:creator>
    <dc:date>2023-04-20T17:48:02Z</dc:date>
    <item>
      <title>lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910129#M3747</link>
      <description>&lt;P&gt;I am hoping someone can provide me with assistance in developing a lisp or lisps that would edit survey figure styles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am hoping to accomplish is to select one or more survey figures, and with a single command toggle their status between Flatten to 2D, at 0 elevation, and true 3 dimensional presentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not finding documentation on how to access the survey figure style through a lisp routine though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not certain that this is even possible with lisp, I have found some documentation that leads me to believe that the portions of the api that reference survey figure styles have not been exposed to lisp, but I'm more a tinkerer with code than and experienced programmer, so I am not sure I am reading the documentation correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also be willing to take a stab at it with C#, but my skills there are even more limited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 15:09:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910129#M3747</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-20T15:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910520#M3748</link>
      <description>&lt;P&gt;&lt;STRONG&gt;hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Have you picture explain your idea&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Or&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attached example drawing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any way you need civil API com&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 17:30:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910520#M3748</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-04-20T17:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910562#M3749</link>
      <description>&lt;P&gt;Hosneyalaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially I would like to be able to switch the styles between these two states with quick command.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STATE 1.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1204801iAB3A3879CEB2FB3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STATE 1.JPG" alt="STATE 1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STATE 2.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1204802i80CAE50F607F36F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STATE 2.JPG" alt="STATE 2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The inspiration for this was a lisp routine I found which will toggle on the display of triangles in a civil 3D surface.&amp;nbsp; Which is the toggle triangles lisp I have attached.&amp;nbsp; Using that as a template I am able to get to the point where I can use the code below to select as survey figure, then have it perform an action to change the style.&amp;nbsp; At this point I am struggling with defining the action.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(vl-load-com)

(defun c:SF2D () (c:SurveyFigure2D))
(defun c:SurveyFigure2D (/ *error* acDoc obj)

(defun *error* (msg)
(if ss
(vla-delete ss)
)
(if acDoc
(vla-endundomark acDoc)
)
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; &amp;lt;esc&amp;gt; or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)

(if (ssget '((0 . "AECC_SVFIGURE*")))
(
; need code to change survey figure style from 3D to 2D here.
)

; Original surface style change is commented out below.
;(progn
; (vla-startundomark
; (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
; )
; (vlax-for x (setq ss (vla-get-activeselectionset acDoc))
; (vlax-put
; (setq obj
; (vlax-get (vlax-get (vlax-get x 'style) 'trianglestyle)
; 'displaystyleplan
; )
; )
; 'visible
; (1- (abs (vlax-get obj 'visible)))
; )
; )
;)
)

(*error* nil)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 17:48:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910562#M3749</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-20T17:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910879#M3750</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know Style cannot be affected through Lisp It must be through .net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May i make a try through Lisp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=780a165a-d1e7-0c12-10e7-44803e78e973" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=780a165a-d1e7-0c12-10e7-44803e78e973&lt;/A&gt;&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="Screenshot_٢٠٢٣_٠٤٢٠_٢٢٤٤٣١.jpg" style="width: 481px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1204869iAEB299FAD6088692/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_٢٠٢٣_٠٤٢٠_٢٢٤٤٣١.jpg" alt="Screenshot_٢٠٢٣_٠٤٢٠_٢٢٤٤٣١.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 19:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910879#M3750</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-04-20T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910896#M3751</link>
      <description>&lt;P&gt;I had very much suspected that it may not be accessible through lisp.&amp;nbsp; Looks like I am going to have to dive into C# to accomplish this.&amp;nbsp; The reference you posted looks like it has a lot of the information I was missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to keep this open for a little bit, just in case anyone else has any good input, but thank you very very much.&amp;nbsp; Now I just have to learn more about C#.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 19:53:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11910896#M3751</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-20T19:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11911047#M3752</link>
      <description>&lt;P&gt;My workflow has a process where I import 3D figures into a drawing for surface creation. Then I have another drawing that has the figures for 2D plan data. Here I generally convert the figures to 2d polylines to minimize file size, and the surface drawing is data referenced into the 2D file.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 20:51:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11911047#M3752</guid>
      <dc:creator>rl_jackson</dc:creator>
      <dc:date>2023-04-20T20:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11911150#M3753</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6144388"&gt;@cody.faltin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you get an idea&amp;nbsp; About C Sharp &amp;amp; CIVIL 3D API&lt;BR /&gt;CAN be used&amp;nbsp; this&amp;nbsp; CODE With some changes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;///  https://forums.autodesk.com/t5/civil-3d-customization/how-to-change-style-of-parcel/m-p/10233647

 var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;
            var styleId = civdoc.Styles.ParcelStyles["Lot"];
            var entOpts = new PromptEntityOptions("\nSelect Parcel");
            entOpts.SetRejectMessage("...not a parcel, try again!");
            entOpts.AddAllowedClass(typeof(Parcel), true);
            var sel = ed.GetEntity(entOpts);
            if (sel.Status != PromptStatus.OK)
                return;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var parcel = (Parcel)tr.GetObject(sel.ObjectId, OpenMode.ForWrite);
                var style = (ParcelStyle)tr.GetObject(styleId, OpenMode.ForRead);
                dynamic oParcel = parcel.AcadObject;
                oParcel.Style = style.AcadObject;
                tr.Commit();
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 21:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11911150#M3753</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-04-20T21:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11913453#M3754</link>
      <description>&lt;P&gt;Thank you so much, between this and a few other tutorials I have followed I feel like I may be able to pull this together.&amp;nbsp; Once I have I will post the finished code.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:18:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11913453#M3754</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-21T18:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916335#M3755</link>
      <description>&lt;P&gt;After a fair amount of trial and error and a great deal of searching I was able to put together the following.&lt;/P&gt;&lt;P&gt;At the moment the two methods only apply to the hard coded style of "Test", but I feel confident I can rework it to allow it to function based on a selection.&amp;nbsp; You will note that several lines are commented as not being necessary, I have left them in place for now as I feel I may be able to use them as a basis for defining the styleID variable based on user selection.&amp;nbsp; But based on my current understanding they are not actually passing any data to the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I have not been able to determine would be how to specify the elevation that figure styles are flattened to. I have located the following reference, but I am unsure of how to implement the get set functionality.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=f321bd87-e521-1e82-6471-326b9ed5a896" target="_blank"&gt;https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=f321bd87-e521-1e82-6471-326b9ed5a896&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices.Styles;
using Autodesk.Civil.DatabaseServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.ApplicationServices;

namespace CDF.SFStyles
{
    public class Commands
    {
        [CommandMethod("SF2D")]
     
        public void SurveyFigure2D()
        {
            
            var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;
            var styleId = civdoc.Styles.SurveyFigureStyles["Test"];
            var entOpts = new PromptEntityOptions("\nSelect SurveyFigure");//These lines are not actually necessary.
            entOpts.SetRejectMessage("...not a survey figure, try again!");//These lines are not actually necessary.
            entOpts.AddAllowedClass(typeof(SurveyFigure), true);           //These lines are not actually necessary.
            var sel = ed.GetEntity(entOpts);                               //These lines are not actually necessary.
            if (sel.Status != PromptStatus.OK)                             //These lines are not actually necessary.
                return;                                                    //These lines are not actually necessary.
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {                
                var style = (SurveyFigureStyle)tr.GetObject(styleId, OpenMode.ForWrite);
                style.NetworkDisplayMode = SurveyElevationDisplayType.FlattenElevation;
                tr.Commit();
            }

        }

        [CommandMethod("SF3D")]

        public void SurveyFigure3D()
        {

            var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;
            var styleId = civdoc.Styles.SurveyFigureStyles["Test"];
            var entOpts = new PromptEntityOptions("\nSelect SurveyFigure");//These lines are not actually necessary.
            entOpts.SetRejectMessage("...not a survey figure, try again!");//These lines are not actually necessary.
            entOpts.AddAllowedClass(typeof(SurveyFigure), true);           //These lines are not actually necessary.
            var sel = ed.GetEntity(entOpts);                               //These lines are not actually necessary.
            if (sel.Status != PromptStatus.OK)                             //These lines are not actually necessary.
                return;                                                    //These lines are not actually necessary.
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {               
                var style = (SurveyFigureStyle)tr.GetObject(styleId, OpenMode.ForWrite);
                style.NetworkDisplayMode = SurveyElevationDisplayType.UseElevation;
                tr.Commit();
            }

        }


    }

    
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This post provided me with the breakthrough for assigning the Elevation display type.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/create-survey-figure-style-c/td-p/4882108" target="_blank"&gt;https://forums.autodesk.com/t5/civil-3d-customization/create-survey-figure-style-c/td-p/4882108&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;Thank you everyone for your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 21:00:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916335#M3755</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-23T21:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916518#M3756</link>
      <description>&lt;P&gt;To flatten to 0 it should just be:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;style.NetworkDisplayMode = SurveyElevationDisplayType.UseElevation;
style.FlattenToElevationBy = 0.0;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Apr 2023 00:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916518#M3756</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-04-24T00:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916597#M3757</link>
      <description>Jeff_M, thank you that was exactly what it needed.</description>
      <pubDate>Mon, 24 Apr 2023 01:38:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11916597#M3757</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-24T01:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: lISP to edit survey figure style.</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11919350#M3758</link>
      <description>&lt;P&gt;Functional code with a few refinements.&amp;nbsp; Now loops through a selection set.&amp;nbsp; Added another method to flatten to a specified elevation.&amp;nbsp; Also added a regenall to the end of all the methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&amp;nbsp;Hosneyalaa, and Jeff_M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices.Styles;
using Autodesk.Civil.DatabaseServices;
using Autodesk.AutoCAD.ApplicationServices;

namespace CDF.SFStyles
{
    public class Commands
    {


        [CommandMethod("SF2D")]

        public void SurveyFigure2D()
        {

            var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;                                             
            
            PromptSelectionResult result = SelectFigures();
            if (result.Status == PromptStatus.OK)
            {

                
                
                foreach (var objectId in result.Value.GetObjectIds())
                {
                    using (Transaction tr = db.TransactionManager.StartTransaction())
                    {
                        SurveyFigure figure = (SurveyFigure)tr.GetObject(objectId, OpenMode.ForRead);
                        SurveyFigureStyle figureStyle = (SurveyFigureStyle)tr.GetObject(figure.StyleId, OpenMode.ForRead);
                        dynamic oFigureStyle = figureStyle.AcadObject;
                        var figureStyleName = oFigureStyle.Name;
                        var styleId = civdoc.Styles.SurveyFigureStyles[$"{figureStyleName}"];

                        figureStyle.NetworkDisplayMode = SurveyElevationDisplayType.FlattenElevation;
                        
                        tr.Commit();
                    }
                    doc.SendStringToExecute("REGENALL ", true, false, true);
                    Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage($"Flattened to 0'");
                }
                
            }
        }

        [CommandMethod("SF2Z")]

        public void SurveyFigure2Z()
        {

            var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;
            var targetZElevIn = ed.GetDouble("\nEnter the desired elevation for flattening survey figures: " );
            var targetZElev = targetZElevIn.Value;

            PromptSelectionResult result = SelectFigures();
            if (result.Status == PromptStatus.OK)
            {



                foreach (var objectId in result.Value.GetObjectIds())
                {
                    using (Transaction tr = db.TransactionManager.StartTransaction())
                    {
                        SurveyFigure figure = (SurveyFigure)tr.GetObject(objectId, OpenMode.ForRead);
                        SurveyFigureStyle figureStyle = (SurveyFigureStyle)tr.GetObject(figure.StyleId, OpenMode.ForRead);
                        dynamic oFigureStyle = figureStyle.AcadObject;
                        var figureStyleName = oFigureStyle.Name;
                        var styleId = civdoc.Styles.SurveyFigureStyles[$"{figureStyleName}"];

                        figureStyle.NetworkDisplayMode = SurveyElevationDisplayType.FlattenElevation;
                        figureStyle.FlattenToElevationBy = targetZElev;
                        tr.Commit();
                    }
                    doc.SendStringToExecute("REGENALL ", true, false, true);
                    Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage($"Flattened to {targetZElev}'");
                }

            }
        }

        [CommandMethod("SF3D")]

        public void SurveyFigure3D()
        {

            var doc = Application.DocumentManager.CurrentDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var civdoc = CivilApplication.ActiveDocument;

            PromptSelectionResult result = SelectFigures();
            if (result.Status == PromptStatus.OK)
            {



                foreach (var objectId in result.Value.GetObjectIds())
                {
                    using (Transaction tr = db.TransactionManager.StartTransaction())
                    {
                        SurveyFigure figure = (SurveyFigure)tr.GetObject(objectId, OpenMode.ForRead);
                        SurveyFigureStyle figureStyle = (SurveyFigureStyle)tr.GetObject(figure.StyleId, OpenMode.ForRead);
                        dynamic oFigureStyle = figureStyle.AcadObject;
                        var figureStyleName = oFigureStyle.Name;
                        var styleId = civdoc.Styles.SurveyFigureStyles[$"{figureStyleName}"];

                        figureStyle.NetworkDisplayMode = SurveyElevationDisplayType.UseElevation;

                        tr.Commit();
                    }
                    doc.SendStringToExecute("REGENALL ", true, false, true);
                    Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage($"Using true elevations");
                }

            }
        }


        private PromptSelectionResult SelectFigures()
        {
            var options = new PromptSelectionOptions();
            options.MessageForAdding = "Add Survey Figures";
            options.MessageForRemoval = "Remove Survey Figures";

            var filter = new SelectionFilter(new TypedValue[]
            {
                new TypedValue((int)DxfCode.Start, "AECC_SVFIGURE")
            });
            return Application.DocumentManager.MdiActiveDocument.Editor.GetSelection(options, filter);
        }


    }
}   &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 04:21:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-edit-survey-figure-style/m-p/11919350#M3758</guid>
      <dc:creator>cody.faltin</dc:creator>
      <dc:date>2023-04-25T04:21:23Z</dc:date>
    </item>
  </channel>
</rss>

