PDA

View Full Version : Calculate function not working in B.O.M. Generator


Poorest Chump
2005-05-11, 04:38 PM
But of course that's a different forum....

If anyone has the time to look into this..."B.O.M. Generator", part of it works. Please try the "Pick Distance or Pick Line" options first... Then the Calculate option.
The problem here is the Calculate function. Please excuse the mess. I'm lost. Someone show me the way to Jesus!!!!!!!!!! Halelujah...whatever...

msretenovic
2005-05-11, 04:40 PM
I tried to upload a .lsp file to get some help (pretty please) but the file is 27.5 kb... too big. Is there some other way for me to "give" my code away?
Have you tried zipping it up? ;)

Poorest Chump
2005-05-11, 05:03 PM
Closest I can guess is it's hanging up somwhere after this:

(if (and (= longitem itemno) (> longqty 1))
(progn
(setq used_of_qty (1+ used_of_qty))

(setq oldqty qtypair)
(setq newqty (cons '1 (itoa used_of_qty)))
(setq newqtylist (entmod (subst newqty oldqty qtyent)))
(if (= drop 0)
(progn

(dropnroll)

);progn

):if
);progn
(progn
(if (= longitem itemno)
(progn

(setq xx (1+ xx))
(setq delitem (ssname ssrest delcount))
(ssdel delitem ssrest)
);progn
);if

I've stared at this piece of cr... for way too long. What's up w/this?

J. Grouchy
2005-05-11, 05:41 PM
I've stared at this piece of cr... for way too long. What's up w/this?

Too many parentheses... ;)

(sorry...couldn't help myself)

Poorest Chump
2005-05-11, 05:57 PM
Yeah, there's a few of those...but at the moment we only have to concern ourselves with 2 (two) of them... but which 2?

Poorest Chump
2005-05-11, 07:09 PM
Alright forget it then. I figured it out w/my OWN little brain (what's left of it (from the 60's/70's))

kennet.sjoberg
2005-05-11, 11:58 PM
Alright forget it then. I figured it out w/my OWN little brain. . . . . . hmmm save what is left, and try this first ; )

In function C:MTO subroutine ll change the variable name "length" to a legal variable name.

I miss the block/dwg callout, the subroutine cochange will fail.

And of course take care of all the global variables and make them local.

debug (setvar "userr2" 1 )

: ) Happy Computing !

kennet