Jump to content

Recommended Posts

Posted

How could I return the total number of layout labs in a given dwg with lisp?

Is it possible to do the same with Diesel?

 

Thanks

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    12

  • SteveK

    11

  • chulse

    7

  • Fatrus

    3

Top Posters In This Topic

Posted

Hi,

Would this work for you:

 

(length (layoutlist))

Not sure about Diesel.

Posted

I'll try it, thanks

 

That would not include the Model tab then, right?

Posted

yep. Cause if you just type in (layoutlist) it'll return all the names of the layouts (without "model")

Posted

No worries. :)

 

Do you require it in Diesel for fields? Cause I'd be interested to know that too...

Posted

Yeah, that's what started me wondering. I'd like to automate my titleblock with a field (with diesel). I just have no idea how.

Posted
Does anyone know how to do this with Diesel? Please?

 

I'm not sure that you can - (layoutlist) itself is an Arx function, and the number is not stored in any Sys Var, so DIESEL is pretty difficult for this task.

 

I'd be intrigued if someone provided DIESEL code to accomplish such a task.

Posted
I'm not sure that you can - (layoutlist) itself is an Arx function, and the number is not stored in any Sys Var, so DIESEL is pretty difficult for this task.

 

I'd be intrigued if someone provided DIESEL code to accomplish such a task.

 

Could if you were using 07. You could use lisp functions in fields. You can access 'lisp variables' now, why not just give us the option to use short lisp functions.

Posted
Could if you were using 07. You could use lisp functions in fields. You can access 'lisp variables' now, why not just give us the option to use short lisp functions.

 

 

I can't believe they would remove that functionality. :x

(...well ok, yes I can...:glare:)

Posted
I can't believe they would remove that functionality. :x

(...well ok, yes I can...:glare:)

I think it was a bug. We went from 06 to 08, so I only heard about it.

Posted
Could if you were using 07. You could use lisp functions in fields. You can access 'lisp variables' now, why not just give us the option to use short lisp functions.

 

I'd like to know how to you use a lisp function within a field;

In the fields table I can only see LispVariable and I'm thinking if you assign a variable (eg (length (layoutlist))), you'd still have to initialize the lisp program at the start of each session... which a client wouldn't like.... but if there's somewhere where fields support lisp functions then we're in business! But is there...?

Posted
I'd like to know how to you use a lisp function within a field;

In the fields table I can only see LispVariable and I'm thinking if you assign a variable (eg (length (layoutlist))), you'd still have to initialize the lisp program at the start of each session... which a client wouldn't like.... but if there's somewhere where fields support lisp functions then we're in business! But is there...?

 

Perhaps in the making....http://www.theswamp.org/index.php?topic=30471.0

Posted
Perhaps in the making....http://www.theswamp.org/index.php?topic=30471.0

 

:) Yeah I think a fair few people are waiting to see Andrea's code... :geek:

 

Still, won't we need to run the lisp program to get the Mlisp to function? (fine for us, but not for clients) :(

Posted
:) Yeah I think a fair few people are waiting to see Andrea's code... :geek:

 

Still, won't we need to run the lisp program to get the Mlisp to function? (fine for us, but not for clients) :(

 

Well, I only send PDFs to clients, so it will work wonders for me :D

Posted
Well, I only send PDFs to clients, so it will work wonders for me :D

 

Hi Cary,

But then why not just assign a user variable to a field (eg userr1), then just before you pdf you update the variable with:

(setvar "userr1" (length(layoutlist)))

or any variable

(setq numLays (length(layoutlist)))

Posted
Hi Cary,

But then why not just assign a user variable to a field (eg userr1), then just before you pdf you update the variable with:

(setq userr1 (length(layoutlist)))

 

Hmm

 

(if (not *CommandReactors-PlotSheetCount*)
 (setq *CommandReactors-PlotSheetCount*
        (vlr-command-reactor
          nil
          '((:vlr-commandWillStart . StrtCMD-PlotSheetCount)
           )
        ) ;_ vlr-command-reactor
 ) ;_ setq
) ;_ if
(defun StrtCMD-PlotSheetCount
      (calling-reactor StrtCMD-PlotSheetCountInfo / theCMDStrt)
 (setq theCMDStrt (strcase (car StrtCMD-PlotSheetCountInfo)))
 (cond
   ((wcmatch theCMDStrt "*PLOT*,*PUBLISH*")
    (setvar "userr1" (length (layoutlist)))
   )
 ) ;_ cond
) ;_ defun

Posted
Hi,

Would this work for you:

 

(length (layoutlist))

Not sure about Diesel.

 

Nice an useful code there! Thanks for that.

Posted
Hmm

 

(if (not *CommandReactors-PlotSheetCount*)
 (setq *CommandReactors-PlotSheetCount*
        (vlr-command-reactor
          nil
          '((:vlr-commandWillStart . StrtCMD-PlotSheetCount)
           )
        ) ;_ vlr-command-reactor
 ) ;_ setq
) ;_ if
(defun StrtCMD-PlotSheetCount
      (calling-reactor StrtCMD-PlotSheetCountInfo / theCMDStrt)
 (setq theCMDStrt (strcase (car StrtCMD-PlotSheetCountInfo)))
 (cond
   ((wcmatch theCMDStrt "*PLOT*,*PUBLISH*")
    (setvar "userr1" (length (layoutlist)))
   )
 ) ;_ cond
) ;_ defun

Yeah I like that Alan. Because then you can add other variables to it that might be referenced in other fields.

Plus, having it in your startup you don't need to worry about updating before pdf'ing.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...