Having issues with this lisp development

Having issues with this lisp development

Markeckert
Enthusiast Enthusiast
1,612 Views
25 Replies
Message 1 of 26

Having issues with this lisp development

Markeckert
Enthusiast
Enthusiast

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?

0 Likes
Accepted solutions (1)
1,613 Views
25 Replies
Replies (25)
Message 21 of 26

Sea-Haven
Mentor
Mentor

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.

 

 

0 Likes
Message 22 of 26

ec-cad
Collaborator
Collaborator

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

0 Likes
Message 23 of 26

ec-cad
Collaborator
Collaborator

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

0 Likes
Message 24 of 26

ec-cad
Collaborator
Collaborator

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

0 Likes
Message 25 of 26

ec-cad
Collaborator
Collaborator
Accepted solution

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 🙂

 

ECCAD

0 Likes
Message 26 of 26

Markeckert
Enthusiast
Enthusiast

Thanks for your help! 

0 Likes