Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having issues with this lisp development

25 REPLIES 25
SOLVED
Reply
Message 1 of 26
Markeckert
712 Views, 25 Replies

Having issues with this lisp development

I've been trying to get this Lisp to accept a page number and pass it on to the called lisp (PageMe.lsp) . The lisp continues to fail and I've tried adding debugging steps. It currently fails at step6 with the error  "too few actual parameters occurred". I don't seem to be able to resolve this error. I've attached the lisp. Can someone help me to resolve this error?

25 REPLIES 25
Message 21 of 26
Sea-Haven
in reply to: Markeckert

I thought you were talking about multiple dwgs not multiple layouts in one dwg or am I considering task wrong ? Any way you can get how many layouts in a dwg its a simple (length (layoutlist)). I would look at your "Page X of Y" I would make it "Page" as text, X is attribute, "of" is text, Y is an attribute then any time you like just run lisp update sheets, This is handy when you change the order of the layouts. You could save the start number in the dwg using Ldata so would work for multiple dwgs, the obvious is to use OBDX and read the sheet number from multiple dwgs etc and update, that what sheetsets does something I don't use as normally only had one dwg. 

 

Ok even better can read the layout as a number using a field in a attribute, taborder, same with max sheet, tabcount.

 

 

Message 22 of 26
ec-cad
in reply to: Markeckert

Been thinking on it. Instead of doing the Dialog, entering max page #, why not just check

how many drawings are in the folder ? A couple of lines of code would get the count, put 

it into max_page and pass it along.

 

On another note, the existing Attributes within your sample drawings from the original posting

have values like "PAGE 1 OF 4" - and latest code gets the first 10 characters, then adds the

max-page (as a string), puts that into the Attributes. However, IF you have 10 or more drawings..

we would have to change the 'stuff_atts', function to parse out that string differently.

Imagine an existing Attribute value, say: "PAGE 12 OF 22". In that case, we would have to

get the first 11 characters, then add the max_page.

 

Will you ever have more than 9 drawings in the target folder ?

 

ECCAD

Message 23 of 26
ec-cad
in reply to: ec-cad

This is a modified CPNNCA.lsp, renamed as CPNNCA2.lsp

It bypasses the Dialog, gets the number of drawings from the current folder.

Uses that # (as a string), as variable 'max_page'.

 

As far as using VLIDE, in the 40 years I've been programming with Lisp, I used it maybe

(3) times, just to check brackets matching... e.g. (.......)(.........), etc.

I usually don't put the variables inside the (defun whatever (/ var1 var2 ...),

so I can do a !var1 at Command Line to see what's up with that var..

Then, when I'm finished debugging (seldom required), I might put them in the (defun 's 

for final version. Sometimes not.

 

ECCAD

Message 24 of 26
ec-cad
in reply to: ec-cad

Here's a function to add to pageme.lsp, to handle sheet numbers > 9.

Will do up to 99 now.

Try to cut/paste just the 'function into top of pageme.lsp, and revise

the stuff_atts to grab the 'old' Attribute value, pass that and the max_page var's,

and use the value 'return' to put into the attributes.

It'll be fun and a learning experience.

 

ECCAD

Message 25 of 26
ec-cad
in reply to: ec-cad

Tested finals if you want them. Skips the dialog for getting # Pages. Handles up to 99 pages.

The only thing is , I don't know for sure the final drawing naming required. If this is not it,

just let me know.

Happy New Year !

Cheers :slightly_smiling_face:

 

ECCAD

Tags (1)
Message 26 of 26
Markeckert
in reply to: Markeckert

Thanks for your help! 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report