×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

autocad 2006 fields

autocad 2006 fields

autocad 2006 fields

(OP)
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

RE: autocad 2006 fields

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

RE: autocad 2006 fields

You can use LISP in Fields only in AutoCAD 2007.

Then you can use both:
(length(layoutlist))
and
(substr(getvar"DWGNAME") 1 (-(strlen(getvar"DWGNAME")) 4))
to solve your problems

Some formatting codes for fields can be found on:
http://www.cadforum.cz/cadforum_en/qaID.asp?tip=3676

Vladimir Michl, www.xanadu.cz

RE: autocad 2006 fields

(OP)
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!!!!!!!

RE: autocad 2006 fields

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources