<?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 Removing cover and index from autonumbering lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13254618#M4339</link>
    <description>&lt;P&gt;I'm using a LISP from Lee Mac Programming (&lt;A href="https://www.lee-mac.com/layoutfield.html" target="_blank"&gt;https://www.lee-mac.com/layoutfield.html&lt;/A&gt;) that can number my layouts automatically. However, I wish it didn't count the cover and the index, so the actual drawings would start at 1, and the total number of pages wouldn't also count those pages. As a bonus, I really prefer when the numbers from 1-9 are preceded by a 0... But it's just for aesthetics.&lt;/P&gt;&lt;P&gt;Anyway, is there any way to fix the .lsp so it does that? Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;;-------------------------=={ Layout Field }==-------------------------;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; This program defines a set of commands which enable the user to ;;&lt;BR /&gt;;; populate a selected annotation object (Text, MText, Attribute) ;;&lt;BR /&gt;;; with a field expression referencing the name and position of the ;;&lt;BR /&gt;;; layout in which the object resides. ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Contrary to the typical use of the CTAB system variable, as offered ;;&lt;BR /&gt;;; by the standard AutoCAD FIELD command, the field expressions ;;&lt;BR /&gt;;; generated by this program directly reference the ActiveX Layout ;;&lt;BR /&gt;;; object within the Layouts Collection, and therefore do not depend ;;&lt;BR /&gt;;; on the layout being current in order to display the correct output. ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; This is particularly advantageous when using the DATAEXTRACTION ;;&lt;BR /&gt;;; command to retrieve data from multi-layout drawings, as field ;;&lt;BR /&gt;;; expressions which reference the CTAB system variable will yield ;;&lt;BR /&gt;;; the same value for every layout when processed by this command. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Author: Lee Mac, Copyright © 2016 - &lt;A href="http://www.lee-mac.com" target="_blank"&gt;www.lee-mac.com&lt;/A&gt; ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Version 1.0 - 2016-12-29 ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; - First release. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Layout Name ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the name of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfname ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).Name&amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Layout Number ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the position of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfnumber ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).TabOrder&amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Sheet Number &amp;amp; Total Sheets ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the position of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides, and the total ;;&lt;BR /&gt;;; number of paperspace layouts in the drawing. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfsheet ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).TabOrder&amp;gt;%"&lt;BR /&gt;" of "&lt;BR /&gt;"%&amp;lt;\\AcExpr %&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (vla-get-layouts (LM:acdoc)))&lt;BR /&gt;"&amp;gt;%).Count&amp;gt;%-1 &amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun layoutfield ( fld / *error* ent )&lt;BR /&gt;&lt;BR /&gt;(defun *error* ( msg )&lt;BR /&gt;(LM:endundo (LM:acdoc))&lt;BR /&gt;(if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))&lt;BR /&gt;(princ (strcat "\nError: " msg))&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(while&lt;BR /&gt;(progn (setvar 'errno 0) (setq ent (nentsel "\nSelect text or attribute: "))&lt;BR /&gt;(cond&lt;BR /&gt;( (= 7 (getvar 'errno))&lt;BR /&gt;(princ "\nMissed, try again.")&lt;BR /&gt;)&lt;BR /&gt;( (null ent) nil)&lt;BR /&gt;( (or (&amp;lt; 2 (length ent))&lt;BR /&gt;(not (wcmatch (cdr (assoc 0 (entget (setq ent (car ent))))) "TEXT,MTEXT,ATTRIB"))&lt;BR /&gt;)&lt;BR /&gt;(princ "\nInvalid object selected.")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(if ent&lt;BR /&gt;(progn&lt;BR /&gt;(LM:startundo (LM:acdoc))&lt;BR /&gt;(apply fld (list (vlax-ename-&amp;gt;vla-object ent)))&lt;BR /&gt;(if (= "ATTRIB" (cdr (assoc 0 (entget ent))))&lt;BR /&gt;(vla-regen (LM:acdoc) acactiveviewport)&lt;BR /&gt;)&lt;BR /&gt;(LM:endundo (LM:acdoc))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;(defun layoutfield:layout ( obj )&lt;BR /&gt;(if (and (vlax-property-available-p obj 'islayout) (= :vlax-true (vla-get-islayout obj)))&lt;BR /&gt;(vla-get-layout obj)&lt;BR /&gt;(layoutfield:layout (LM:owner obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Owner - Lee Mac&lt;BR /&gt;;; A wrapper for the objectidtoobject method &amp;amp; ownerid property to enable&lt;BR /&gt;;; compatibility with 32-bit &amp;amp; 64-bit systems&lt;BR /&gt;&lt;BR /&gt;(defun LM:owner ( obj )&lt;BR /&gt;(eval&lt;BR /&gt;(list 'defun 'LM:owner '( obj )&lt;BR /&gt;(if (vlax-method-applicable-p obj 'ownerid32)&lt;BR /&gt;(list 'vla-objectidtoobject32 (LM:acdoc) '(vla-get-ownerid32 obj))&lt;BR /&gt;(list 'vla-objectidtoobject (LM:acdoc) '(vla-get-ownerid obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(LM:owner obj)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; ObjectID - Lee Mac&lt;BR /&gt;;; Returns a string containing the ObjectID of a supplied VLA-Object&lt;BR /&gt;;; Compatible with 32-bit &amp;amp; 64-bit systems&lt;BR /&gt;&lt;BR /&gt;(defun LM:objectid ( obj )&lt;BR /&gt;(eval&lt;BR /&gt;(list 'defun 'LM:objectid '( obj )&lt;BR /&gt;(if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring)&lt;BR /&gt;(list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false)&lt;BR /&gt;'(itoa (vla-get-objectid obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(LM:objectid obj)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; Start Undo - Lee Mac&lt;BR /&gt;;; Opens an Undo Group.&lt;BR /&gt;&lt;BR /&gt;(defun LM:startundo ( doc )&lt;BR /&gt;(LM:endundo doc)&lt;BR /&gt;(vla-startundomark doc)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; End Undo - Lee Mac&lt;BR /&gt;;; Closes an Undo Group.&lt;BR /&gt;&lt;BR /&gt;(defun LM:endundo ( doc )&lt;BR /&gt;(while (= 8 (logand 8 (getvar 'undoctl)))&lt;BR /&gt;(vla-endundomark doc)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; Active Document - Lee Mac&lt;BR /&gt;;; Returns the VLA Active Document Object&lt;BR /&gt;&lt;BR /&gt;(defun LM:acdoc nil&lt;BR /&gt;(eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))&lt;BR /&gt;(LM:acdoc)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(vl-load-com) (princ)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; End of File ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 20:43:34 GMT</pubDate>
    <dc:creator>beatriz.mourao</dc:creator>
    <dc:date>2025-01-10T20:43:34Z</dc:date>
    <item>
      <title>Removing cover and index from autonumbering lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13254618#M4339</link>
      <description>&lt;P&gt;I'm using a LISP from Lee Mac Programming (&lt;A href="https://www.lee-mac.com/layoutfield.html" target="_blank"&gt;https://www.lee-mac.com/layoutfield.html&lt;/A&gt;) that can number my layouts automatically. However, I wish it didn't count the cover and the index, so the actual drawings would start at 1, and the total number of pages wouldn't also count those pages. As a bonus, I really prefer when the numbers from 1-9 are preceded by a 0... But it's just for aesthetics.&lt;/P&gt;&lt;P&gt;Anyway, is there any way to fix the .lsp so it does that? Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;;-------------------------=={ Layout Field }==-------------------------;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; This program defines a set of commands which enable the user to ;;&lt;BR /&gt;;; populate a selected annotation object (Text, MText, Attribute) ;;&lt;BR /&gt;;; with a field expression referencing the name and position of the ;;&lt;BR /&gt;;; layout in which the object resides. ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Contrary to the typical use of the CTAB system variable, as offered ;;&lt;BR /&gt;;; by the standard AutoCAD FIELD command, the field expressions ;;&lt;BR /&gt;;; generated by this program directly reference the ActiveX Layout ;;&lt;BR /&gt;;; object within the Layouts Collection, and therefore do not depend ;;&lt;BR /&gt;;; on the layout being current in order to display the correct output. ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; This is particularly advantageous when using the DATAEXTRACTION ;;&lt;BR /&gt;;; command to retrieve data from multi-layout drawings, as field ;;&lt;BR /&gt;;; expressions which reference the CTAB system variable will yield ;;&lt;BR /&gt;;; the same value for every layout when processed by this command. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Author: Lee Mac, Copyright © 2016 - &lt;A href="http://www.lee-mac.com" target="_blank"&gt;www.lee-mac.com&lt;/A&gt; ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Version 1.0 - 2016-12-29 ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; - First release. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Layout Name ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the name of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfname ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).Name&amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Layout Number ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the position of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfnumber ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).TabOrder&amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; Sheet Number &amp;amp; Total Sheets ;;&lt;BR /&gt;;; ;;&lt;BR /&gt;;; Generates a field expression referencing the position of the layout ;;&lt;BR /&gt;;; in which the selected annotation object resides, and the total ;;&lt;BR /&gt;;; number of paperspace layouts in the drawing. ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun c:lfsheet ( )&lt;BR /&gt;(layoutfield&lt;BR /&gt;'(lambda ( obj )&lt;BR /&gt;(vla-put-textstring obj&lt;BR /&gt;(strcat&lt;BR /&gt;"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (layoutfield:layout obj))&lt;BR /&gt;"&amp;gt;%).TabOrder&amp;gt;%"&lt;BR /&gt;" of "&lt;BR /&gt;"%&amp;lt;\\AcExpr %&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;(LM:objectid (vla-get-layouts (LM:acdoc)))&lt;BR /&gt;"&amp;gt;%).Count&amp;gt;%-1 &amp;gt;%"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(defun layoutfield ( fld / *error* ent )&lt;BR /&gt;&lt;BR /&gt;(defun *error* ( msg )&lt;BR /&gt;(LM:endundo (LM:acdoc))&lt;BR /&gt;(if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))&lt;BR /&gt;(princ (strcat "\nError: " msg))&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(while&lt;BR /&gt;(progn (setvar 'errno 0) (setq ent (nentsel "\nSelect text or attribute: "))&lt;BR /&gt;(cond&lt;BR /&gt;( (= 7 (getvar 'errno))&lt;BR /&gt;(princ "\nMissed, try again.")&lt;BR /&gt;)&lt;BR /&gt;( (null ent) nil)&lt;BR /&gt;( (or (&amp;lt; 2 (length ent))&lt;BR /&gt;(not (wcmatch (cdr (assoc 0 (entget (setq ent (car ent))))) "TEXT,MTEXT,ATTRIB"))&lt;BR /&gt;)&lt;BR /&gt;(princ "\nInvalid object selected.")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(if ent&lt;BR /&gt;(progn&lt;BR /&gt;(LM:startundo (LM:acdoc))&lt;BR /&gt;(apply fld (list (vlax-ename-&amp;gt;vla-object ent)))&lt;BR /&gt;(if (= "ATTRIB" (cdr (assoc 0 (entget ent))))&lt;BR /&gt;(vla-regen (LM:acdoc) acactiveviewport)&lt;BR /&gt;)&lt;BR /&gt;(LM:endundo (LM:acdoc))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;(defun layoutfield:layout ( obj )&lt;BR /&gt;(if (and (vlax-property-available-p obj 'islayout) (= :vlax-true (vla-get-islayout obj)))&lt;BR /&gt;(vla-get-layout obj)&lt;BR /&gt;(layoutfield:layout (LM:owner obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Owner - Lee Mac&lt;BR /&gt;;; A wrapper for the objectidtoobject method &amp;amp; ownerid property to enable&lt;BR /&gt;;; compatibility with 32-bit &amp;amp; 64-bit systems&lt;BR /&gt;&lt;BR /&gt;(defun LM:owner ( obj )&lt;BR /&gt;(eval&lt;BR /&gt;(list 'defun 'LM:owner '( obj )&lt;BR /&gt;(if (vlax-method-applicable-p obj 'ownerid32)&lt;BR /&gt;(list 'vla-objectidtoobject32 (LM:acdoc) '(vla-get-ownerid32 obj))&lt;BR /&gt;(list 'vla-objectidtoobject (LM:acdoc) '(vla-get-ownerid obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(LM:owner obj)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; ObjectID - Lee Mac&lt;BR /&gt;;; Returns a string containing the ObjectID of a supplied VLA-Object&lt;BR /&gt;;; Compatible with 32-bit &amp;amp; 64-bit systems&lt;BR /&gt;&lt;BR /&gt;(defun LM:objectid ( obj )&lt;BR /&gt;(eval&lt;BR /&gt;(list 'defun 'LM:objectid '( obj )&lt;BR /&gt;(if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring)&lt;BR /&gt;(list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false)&lt;BR /&gt;'(itoa (vla-get-objectid obj))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(LM:objectid obj)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; Start Undo - Lee Mac&lt;BR /&gt;;; Opens an Undo Group.&lt;BR /&gt;&lt;BR /&gt;(defun LM:startundo ( doc )&lt;BR /&gt;(LM:endundo doc)&lt;BR /&gt;(vla-startundomark doc)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; End Undo - Lee Mac&lt;BR /&gt;;; Closes an Undo Group.&lt;BR /&gt;&lt;BR /&gt;(defun LM:endundo ( doc )&lt;BR /&gt;(while (= 8 (logand 8 (getvar 'undoctl)))&lt;BR /&gt;(vla-endundomark doc)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;;; Active Document - Lee Mac&lt;BR /&gt;;; Returns the VLA Active Document Object&lt;BR /&gt;&lt;BR /&gt;(defun LM:acdoc nil&lt;BR /&gt;(eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))&lt;BR /&gt;(LM:acdoc)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;&lt;BR /&gt;(vl-load-com) (princ)&lt;BR /&gt;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;BR /&gt;;; End of File ;;&lt;BR /&gt;;;----------------------------------------------------------------------;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 20:43:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13254618#M4339</guid>
      <dc:creator>beatriz.mourao</dc:creator>
      <dc:date>2025-01-10T20:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Removing cover and index from autonumbering lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13254923#M4340</link>
      <description>&lt;P&gt;A suggestion as our title block had 2 attributes page &amp;amp; total. We had a lisp we would run and it would redo the values in the 2 attributes, but they were not auto update, yes the D01 D02 etc was produced. By using a custom lisp rather than a field may be the way to go, it can ignore the 1st 2 layouts then start numbering. Post a sample dwg with your title block in a layout if you want some thing like this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 01:11:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13254923#M4340</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-01-11T01:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Removing cover and index from autonumbering lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13255650#M4341</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10869448"&gt;@beatriz.mourao&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the code line #12 you see -1 ?&lt;/P&gt;&lt;P&gt;if you change it to -3, the total of layouts will subtract by 3. it's -3 cause it includes the "Model" layout but have&amp;nbsp;you thought what would happen if your drawing will miss cover/index sheets?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:lfsheet ( )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (layoutfield:layout obj))
"&amp;gt;%).TabOrder&amp;gt;%"
" of "
"%&amp;lt;\\AcExpr %&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (vla-get-layouts (LM:acdoc)))
"&amp;gt;%).Count&amp;gt;%-1 &amp;gt;%"
)
)
)
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 17:51:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13255650#M4341</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2025-01-11T17:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Removing cover and index from autonumbering lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13255668#M4342</link>
      <description>&lt;P&gt;is the following what you want&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;;-------------------------=={ Layout Field }==-------------------------;;
;; ;;
;; This program defines a set of commands which enable the user to ;;
;; populate a selected annotation object (Text, MText, Attribute) ;;
;; with a field expression referencing the name and position of the ;;
;; layout in which the object resides. ;;
;; ;;
;; Contrary to the typical use of the CTAB system variable, as offered ;;
;; by the standard AutoCAD FIELD command, the field expressions ;;
;; generated by this program directly reference the ActiveX Layout ;;
;; object within the Layouts Collection, and therefore do not depend ;;
;; on the layout being current in order to display the correct output. ;;
;; ;;
;; This is particularly advantageous when using the DATAEXTRACTION ;;
;; command to retrieve data from multi-layout drawings, as field ;;
;; expressions which reference the CTAB system variable will yield ;;
;; the same value for every layout when processed by this command. ;;
;;----------------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2016 - www.lee-mac.com ;;
;;----------------------------------------------------------------------;;
;; Version 1.0 - 2016-12-29 ;;
;; ;;
;; - First release. ;;
;;----------------------------------------------------------------------;;

;;----------------------------------------------------------------------;;
;; Layout Name ;;
;; ;;
;; Generates a field expression referencing the name of the layout ;;
;; in which the selected annotation object resides. ;;
;;----------------------------------------------------------------------;;

(defun c:lfname ( )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (layoutfield:layout obj))
"&amp;gt;%).Name&amp;gt;%"
)
)
)
)
)

;;----------------------------------------------------------------------;;
;; Layout Number ;;
;; ;;
;; Generates a field expression referencing the position of the layout ;;
;; in which the selected annotation object resides. ;;
;;----------------------------------------------------------------------;;

(defun c:lfnumber ( )
(if (and (&amp;lt; (vla-get-taborder (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
    	    (1- (vla-get-count (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))))
         )
         (&amp;lt; 1 (vla-get-taborder (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)))))
    )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
"%&amp;lt;\\AcExpr					
%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (layoutfield:layout obj))
"&amp;gt;%).TabOrder&amp;gt;%-1&amp;gt;%"
)
)
)
)
(princ "\nN/A to Model, Cover or Index")
)
(princ)
)

;;----------------------------------------------------------------------;;
;; Sheet Number &amp;amp; Total Sheets ;;
;; ;;
;; Generates a field expression referencing the position of the layout ;;
;; in which the selected annotation object resides, and the total ;;
;; number of paperspace layouts in the drawing. ;;
;;----------------------------------------------------------------------;;

(defun c:lfsheet ( )
(if (and (&amp;lt; (vla-get-taborder (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
	    (1- (vla-get-count (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))))
         )
	 (&amp;lt; 1 (vla-get-taborder (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)))))
    )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
"%&amp;lt;\\AcExpr					 
%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (layoutfield:layout obj))		
"&amp;gt;%).TabOrder&amp;gt;%-1&amp;gt;%"				; komondormrex
" of "
"%&amp;lt;\\AcExpr %&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
(LM:objectid (vla-get-layouts (LM:acdoc)))	; komondormrex
"&amp;gt;%).Count&amp;gt;%-3 &amp;gt;%"
)
)
)
)
(princ "\nN/A to Model, Cover or Index")
)
(princ)
)

;;----------------------------------------------------------------------;;

(defun layoutfield ( fld / *error* ent )

(defun *error* ( msg )
(LM:endundo (LM:acdoc))
(if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))
(princ (strcat "\nError: " msg))
)
(princ)
)

(while
(progn (setvar 'errno 0) (setq ent (nentsel "\nSelect text or attribute: "))
(cond
( (= 7 (getvar 'errno))
(princ "\nMissed, try again.")
)
( (null ent) nil)
( (or (&amp;lt; 2 (length ent))
(not (wcmatch (cdr (assoc 0 (entget (setq ent (car ent))))) "TEXT,MTEXT,ATTRIB"))
)
(princ "\nInvalid object selected.")
)
)
)
)
(if ent
(progn
(LM:startundo (LM:acdoc))
(apply fld (list (vlax-ename-&amp;gt;vla-object ent)))
(if (= "ATTRIB" (cdr (assoc 0 (entget ent))))
(vla-regen (LM:acdoc) acactiveviewport)
)
(LM:endundo (LM:acdoc))
)
)
(princ)
)
(defun layoutfield:layout ( obj )
(if (and (vlax-property-available-p obj 'islayout) (= :vlax-true (vla-get-islayout obj)))
(vla-get-layout obj)
(layoutfield:layout (LM:owner obj))
)
)

;; Owner - Lee Mac
;; A wrapper for the objectidtoobject method &amp;amp; ownerid property to enable
;; compatibility with 32-bit &amp;amp; 64-bit systems

(defun LM:owner ( obj )
(eval
(list 'defun 'LM:owner '( obj )
(if (vlax-method-applicable-p obj 'ownerid32)
(list 'vla-objectidtoobject32 (LM:acdoc) '(vla-get-ownerid32 obj))
(list 'vla-objectidtoobject (LM:acdoc) '(vla-get-ownerid obj))
)
)
)
(LM:owner obj)
)

;; ObjectID - Lee Mac
;; Returns a string containing the ObjectID of a supplied VLA-Object
;; Compatible with 32-bit &amp;amp; 64-bit systems

(defun LM:objectid ( obj )
(eval
(list 'defun 'LM:objectid '( obj )
(if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring)
(list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false)
'(itoa (vla-get-objectid obj))
)
)
)
(LM:objectid obj)
)

;; Start Undo - Lee Mac
;; Opens an Undo Group.

(defun LM:startundo ( doc )
(LM:endundo doc)
(vla-startundomark doc)
)

;; End Undo - Lee Mac
;; Closes an Undo Group.

(defun LM:endundo ( doc )
(while (= 8 (logand 8 (getvar 'undoctl)))
(vla-endundomark doc)
)
)

;; Active Document - Lee Mac
;; Returns the VLA Active Document Object

(defun LM:acdoc nil
(eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
(LM:acdoc)
)


;;----------------------------------------------------------------------;;

(vl-load-com) (princ)

;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Jan 2025 18:35:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/removing-cover-and-index-from-autonumbering-lisp/m-p/13255668#M4342</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-01-11T18:35:17Z</dc:date>
    </item>
  </channel>
</rss>

