chulse Posted September 29, 2009 Share Posted September 29, 2009 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 Quote Link to comment Share on other sites More sharing options...
SteveK Posted September 29, 2009 Share Posted September 29, 2009 Hi, Would this work for you: (length (layoutlist)) Not sure about Diesel. Quote Link to comment Share on other sites More sharing options...
chulse Posted September 29, 2009 Author Share Posted September 29, 2009 I'll try it, thanks That would not include the Model tab then, right? Quote Link to comment Share on other sites More sharing options...
SteveK Posted September 29, 2009 Share Posted September 29, 2009 yep. Cause if you just type in (layoutlist) it'll return all the names of the layouts (without "model") Quote Link to comment Share on other sites More sharing options...
chulse Posted September 29, 2009 Author Share Posted September 29, 2009 Thanks Quote Link to comment Share on other sites More sharing options...
SteveK Posted September 29, 2009 Share Posted September 29, 2009 No worries. Do you require it in Diesel for fields? Cause I'd be interested to know that too... Quote Link to comment Share on other sites More sharing options...
chulse Posted September 29, 2009 Author Share Posted September 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
chulse Posted September 29, 2009 Author Share Posted September 29, 2009 Does anyone know how to do this with Diesel? Please? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 29, 2009 Share Posted September 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted September 29, 2009 Share Posted September 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
chulse Posted September 29, 2009 Author Share Posted September 29, 2009 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. (...well ok, yes I can...) Quote Link to comment Share on other sites More sharing options...
alanjt Posted September 29, 2009 Share Posted September 29, 2009 I can't believe they would remove that functionality. (...well ok, yes I can...) I think it was a bug. We went from 06 to 08, so I only heard about it. Quote Link to comment Share on other sites More sharing options...
SteveK Posted September 30, 2009 Share Posted September 30, 2009 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...? Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 1, 2009 Share Posted October 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
SteveK Posted October 1, 2009 Share Posted October 1, 2009 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... Still, won't we need to run the lisp program to get the Mlisp to function? (fine for us, but not for clients) Quote Link to comment Share on other sites More sharing options...
chulse Posted October 1, 2009 Author Share Posted October 1, 2009 Yeah I think a fair few people are waiting to see Andrea's code... 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 Quote Link to comment Share on other sites More sharing options...
SteveK Posted October 1, 2009 Share Posted October 1, 2009 Well, I only send PDFs to clients, so it will work wonders for me 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))) Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 1, 2009 Share Posted October 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
CADMASTER1128 Posted October 1, 2009 Share Posted October 1, 2009 Hi,Would this work for you: (length (layoutlist)) Not sure about Diesel. Nice an useful code there! Thanks for that. Quote Link to comment Share on other sites More sharing options...
SteveK Posted October 1, 2009 Share Posted October 1, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.