<?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 Navigating C3D API - Assigning Values to Variables within Styles in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12317292#M2852</link>
    <description>&lt;P&gt;I've been working on a routine to help adjust the text height (hopefully someday more fields as needed) of Civil 3D Note Label through direct edits of the Note Label Style. The goal of this routine is to grab a number of note labels, and for each label, get it's corresponding style and adjust the text height field of the style (basically a bulk edit).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received some great help with the bulk of the code from this forum and tried to expand on it but still feel as if I'm missing how to reference various interfaces for these styles. Below, if I remove lines 14-18, the code functions as intended except dragged components retain their original text height. Looking around in the API I thought I would understand how to map to the draggedcomponentstyle and adjust the 'textheight' field (see images below) but I receive this error saying I have a bad argument type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brian_2-1697728542897.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281294iFAD8C23D276BD350/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_2-1697728542897.png" alt="brian_2-1697728542897.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program seems to recognize the interface object but I don't know if I have a problem with my text height argument (input, name, etc.) or something else. Any help with debugging my bad argument type would be appreciated. I apologize too as I'm still very new to the lisp routines.&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="general"&gt;(defun c:test (/ th ss i lbl style txtcomponents dcs)
    (setq th (getreal "Enter Paperspace Height (inches): ") ) ;; ext Height 'th' for paper space
    (if (setq ss (ssget "_:R" '((0 . "AECC_GENERAL_NOTE_LABEL"))))
        (progn
            (setq i 0)
            (while (setq ent (ssname ss i))
                (setq lbl (vlax-ename-&amp;gt;vla-object ent))
                (setq style (vlax-get lbl 'labelstyle)
                    txtcomponents (vlax-get style 'textcomponents)
                )
                (vlax-for comp txtcomponents
                    (vlax-put comp 'height (/ th 12)) ;; Plotted height based on user input
                )
                (setq style (vlax-get lbl 'labelstyle)
                    dcs (vlax-get style 'draggedcomponentstyle)
                )
                (vlax-for com dcs
                    (vlax-put com 'textheight (/ th 12)) ;; Plotted height based on user input
                )
                (setq i (1+ i))
            )
        )
    )
  (princ)
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="brian_1-1697728108591.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281285i809F25B97993AC58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_1-1697728108591.png" alt="brian_1-1697728108591.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Img 1 - Label Style&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brian_0-1697727973451.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281282iC4D5FE98B96AEF25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_0-1697727973451.png" alt="brian_0-1697727973451.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Img 2 - Dragged Component Style&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 15:31:06 GMT</pubDate>
    <dc:creator>brian</dc:creator>
    <dc:date>2023-10-19T15:31:06Z</dc:date>
    <item>
      <title>Navigating C3D API - Assigning Values to Variables within Styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12317292#M2852</link>
      <description>&lt;P&gt;I've been working on a routine to help adjust the text height (hopefully someday more fields as needed) of Civil 3D Note Label through direct edits of the Note Label Style. The goal of this routine is to grab a number of note labels, and for each label, get it's corresponding style and adjust the text height field of the style (basically a bulk edit).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received some great help with the bulk of the code from this forum and tried to expand on it but still feel as if I'm missing how to reference various interfaces for these styles. Below, if I remove lines 14-18, the code functions as intended except dragged components retain their original text height. Looking around in the API I thought I would understand how to map to the draggedcomponentstyle and adjust the 'textheight' field (see images below) but I receive this error saying I have a bad argument type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brian_2-1697728542897.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281294iFAD8C23D276BD350/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_2-1697728542897.png" alt="brian_2-1697728542897.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program seems to recognize the interface object but I don't know if I have a problem with my text height argument (input, name, etc.) or something else. Any help with debugging my bad argument type would be appreciated. I apologize too as I'm still very new to the lisp routines.&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="general"&gt;(defun c:test (/ th ss i lbl style txtcomponents dcs)
    (setq th (getreal "Enter Paperspace Height (inches): ") ) ;; ext Height 'th' for paper space
    (if (setq ss (ssget "_:R" '((0 . "AECC_GENERAL_NOTE_LABEL"))))
        (progn
            (setq i 0)
            (while (setq ent (ssname ss i))
                (setq lbl (vlax-ename-&amp;gt;vla-object ent))
                (setq style (vlax-get lbl 'labelstyle)
                    txtcomponents (vlax-get style 'textcomponents)
                )
                (vlax-for comp txtcomponents
                    (vlax-put comp 'height (/ th 12)) ;; Plotted height based on user input
                )
                (setq style (vlax-get lbl 'labelstyle)
                    dcs (vlax-get style 'draggedcomponentstyle)
                )
                (vlax-for com dcs
                    (vlax-put com 'textheight (/ th 12)) ;; Plotted height based on user input
                )
                (setq i (1+ i))
            )
        )
    )
  (princ)
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="brian_1-1697728108591.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281285i809F25B97993AC58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_1-1697728108591.png" alt="brian_1-1697728108591.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Img 1 - Label Style&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brian_0-1697727973451.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1281282iC4D5FE98B96AEF25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brian_0-1697727973451.png" alt="brian_0-1697727973451.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Img 2 - Dragged Component Style&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 15:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12317292#M2852</guid>
      <dc:creator>brian</dc:creator>
      <dc:date>2023-10-19T15:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Navigating C3D API - Assigning Values to Variables within Styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12317613#M2853</link>
      <description>&lt;P&gt;Try this. The DraggedState TextHeight cannot be set if the style is set to As Composed so I added a check for that.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:test (/ th ss i lbl style txtcomponents dcs)
    (setq th (getreal "Enter Paperspace Height (inches): ") ) ;; ext Height 'th' for paper space
    (if (setq ss (ssget "_:R" '((0 . "AECC_GENERAL_NOTE_LABEL"))))
        (progn
            (setq i 0)
            (while (setq ent (ssname ss i))
                (setq lbl (vlax-ename-&amp;gt;vla-object ent))
                (setq style (vlax-get lbl 'labelstyle)
                    txtcomponents (vlax-get style 'textcomponents)
                )
                (vlax-for comp txtcomponents
                    (vlax-put comp 'height (/ th 12)) ;; Plotted height based on user input
                )
	      (setq dcs (vlax-get style 'draggedcomponentstyle))
	      (if (= (vlax-get (vlax-get dcs 'stacktext) 'value) -1) ;;can't set the textheight if dragged state is As Composed
                (vlax-put dcs 'textheight (/ th 12)) ;; Plotted height based on user input
		)
                (setq i (1+ i))
            )
        )
    )
  (princ)
  )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Oct 2023 17:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12317613#M2853</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-10-19T17:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Navigating C3D API - Assigning Values to Variables within Styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12318294#M2854</link>
      <description>&lt;P&gt;Thank you for that! I realize I posted that on a different account. That did work in fact. I'll have to keep an eye on that in the future if the field conflict with other display modes.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 23:59:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12318294#M2854</guid>
      <dc:creator>CogoCody</dc:creator>
      <dc:date>2023-10-19T23:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Navigating C3D API - Assigning Values to Variables within Styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12320254#M2855</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14198562"&gt;@CogoCody&lt;/a&gt;&amp;nbsp;one other thing to note is that you had a foreach on the dcs, the dcs does not have sub-objects, it is just one object.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 17:45:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/navigating-c3d-api-assigning-values-to-variables-within-styles/m-p/12320254#M2855</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-10-20T17:45:08Z</dc:date>
    </item>
  </channel>
</rss>

