Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

autocad 2006 fields

Status
Not open for further replies.

tzinger

Aerospace
Dec 16, 2002
42
Anybody played around with fields yet?

I am trying to get a total number of tabs. I can use ctab to harvest the name of tab, but I really need the qty of tabs or the variable (if any) to read the last tab.

Also, looking to remove the ".dwg" from the dwgname variable.

I am currently using strings but cannot figure out how to get strings to do this.

tzinger
 
Replies continue below

Recommended for you

tzinger,

Have been searching high and low for that ability also.

Lisp function (Length(Layoutlist)) does return the number of layout tabs (minus the model tab), so you do end up with the total number of tabs. That being said, my ability to write lisp from scratch is non-existant, or even how to get end result into a field at this time.

Anybody else, Is it possible to get this into a DIESEL format (available under fields pull downs).

I apologize if this gets you nowhere faster.

Jimbo
 
I think I am on to something with this, its a little choppy but it works. I have created a lisp routine to undefine the regen command, then create a second lisp routine called regen. (or you could just create one called update...See below....
(Defun C:UPDATE ()
(setq qty(length(layoutlist)))
(setvar"INTERSECTIONCOLOR" QTY)
(command "REGEN"))

This rountine highjacks the sysvar intersectioncolor....its not a very important variable and rarely used, I suppose you could get its value then reset it when finished but let proceed....by high jacking the variable and seting it to the number of layout tabs***(setq qty(length(layoutlist)))***you can then call it using fields in your title block.....

works great!!!!!!!
 
In LISP, this will get the number of layout tabs (includes one for the Model one also)

(setq QTY (vla-get-count (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))))

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor