View Full Version : Help tidying up BOM routine
Poorest Chump
2005-05-12, 08:12 PM
I'm pretty sure nobody has time to check my sloppy work... but...I think I'm getting close. Someone please try to run this routine... and don't get hung up on how big-a-mess this is. We're only concerned with the calculate function right now... not everything else that may be wrong. There's probably lots of better ways to accomplish this but I don't think I'm as smart as most of you guys. The problem at the moment is: Why is this thing creating 3 copies of "material.dwg" on top of each other? I'll worry about the rest later.
Please setvar "userr2" to something other than "0" before running. Run the "Pick Distance/line" several times first to get some B.O.M.'s to calculate... then you may want to change some of the quanties and descriptions to see what's happening. Then Calculate. It's suposed to figure drops... eventually.
kennet.sjoberg
2005-05-12, 09:14 PM
. . . . Run the "Pick Distance/line" first to get a B.O.M. to calculate. . .
You still have to include the "callout.dwg" as mentioned in earlier thread.
Command: mto
Modify b.o.m.,Calculate, pick Distance or <pick Line>: d
Select endpoints/intersections to Dimension: Specify second point:
Select Item Callout arrowhead endpoint:
Select Item Callout Location:
"callout.dwg": Can't find file in search path:
: ) Happy Computing !
kennet
Poorest Chump
2005-05-12, 09:15 PM
Hey, Jerryb.... I think I may have figured out what's happening... but to fix it... hahahahahahahahahahahahaahah... Are you some kind of idiot or what?
Poorest Chump
2005-05-12, 09:19 PM
Oh yeah, ... Callout... Yeah... you probably need that.... Like I said... ima idiot...
Poorest Chump
2005-05-12, 09:35 PM
Hey ya'll... I got a chainsaw and a sledge hammer... Who wants to help me build a house?
madcadder
2005-05-12, 09:42 PM
I've got one drawn for you already
and a can of gas in the garage.
Poorest Chump
2005-05-12, 09:45 PM
oooooo... what I can do with a can of gas...
kennet.sjoberg
2005-05-12, 10:37 PM
It is a lot of code jumping here ; )
Try replace line 571 and 584 to avoid error
(ssdel delitem ssrest)
with
(if delitem (ssdel delitem ssrest) ( ))
BTW what is the line command suppose to do ?
: ) Happy Computing !
kennet
Poorest Chump
2005-05-12, 10:46 PM
aah the line command.... That's so everyone knows I don't know how to program...
not really... It's a chainsaw....hahahaha
kennet.sjoberg
2005-05-12, 10:57 PM
Please be serious,
If You have more than 2 pause You can use this two lines
(command "._line" )
(while (= 1 (logand (getvar "CMDACTIVE") 1)) (command PAUSE ) )
so what is the line command suppose to do ?
: ) Happy Computing !
kennet
Poorest Chump
2005-05-12, 11:01 PM
I WAS being serious. I use it so I can "cut" in (and escape) and try to figure out what's going on with the routine. Is there a better way?
kennet.sjoberg
2005-05-12, 11:07 PM
Yes, debuging in vlide works great
: ) Happy Computing !
kennet
Poorest Chump
2005-05-12, 11:30 PM
Hey, Hey Waitaminute there buster... you can't just bait me & run off w/out giving me the instruction book.... I think there's something illegal about that.
kennet.sjoberg
2005-05-12, 11:42 PM
Command: VLIDE
then press [F1] button
: ) Happy Computing !
kennet, over and out
Poorest Chump
2005-05-13, 12:01 AM
Sounds easy enough... works kinda' like "RAID" right? Gets rid of bugs? I think I might need a bigger can. Maybe that GAS CAN will do a better job for MY routine.... Gotta match?
kennet.sjoberg
2005-05-13, 11:00 AM
Nope, VLIDE is a especial editor for AutoCAD Lisp / Visulal LISP
with debug, format and some other features, enjoy it with a pint of beer instead of a can of gas.
: ) Happy Computing, and take care !
kennet
Poorest Chump
2005-05-13, 03:01 PM
Thanks, I believe I will... a (3) beer primer... then margaritas... Margarita Friday... alll day long... drop by the palapa & I'll build you one... 5:00 pm (central (U.S.))... sharp. Don't be late.
Poorest Chump
2005-05-13, 04:49 PM
Anybody out there care to fix my logic in this routine? All this "code jumping" is driving me up the wall...I think this is the problem... really bad logic...
Poorest Chump
2005-05-13, 06:58 PM
C'mon.... This should be a big challenge to all you "lisp geniuses". If I can't get some help from you guys I may do something desperate. At the very least, I think you all should show me that you LOVE me & CARE DEEPLY for my SYMPTOMATIC RETARDATION.
AMEN.
Wanderer
2005-05-13, 07:01 PM
C'mon.... This should be a big challenge to all you "lisp geniuses". If I can't get some help from you guys I may do something desperate. At the very least, I think you all should show me that you LOVE me & CARE DEEPLY for my SYMPTOMATIC RETARDATION.
AMEN.
something desperate?
~calls out to the lisp geniuses~ Quick, someone help jerry... he's approaching his computer, and he's holding a m****station box!!!!!!! Someone stage an intervention!!! ;)
Poorest Chump
2005-05-13, 07:09 PM
MicroStation? Now why didn't I think of that... Maybe there really is a God...
lance.81922
2005-05-13, 09:09 PM
OK, I downloaded and unzipped the LSP, got the drawings, put 'em in my path, set USERR@ to 1, drew a line, ran the beast, picked the line, the BOM stuff got inserted, and the line length is there and correct. Now what?
Poorest Chump
2005-05-14, 05:08 PM
Run the thing several times picking distances to get several "bom's". Change the descriptions manually (edit attribute) leaving several the same (as each other) to be able to see if the program is working right. Change some of the "qty's" manually (to give the routine something to live for). Then rerun the routine and "calculate". It's putting several copies of "material.dwg" (I'm sure because of jumping out of "calcloop" to "getanother" and having to come back & finish out the loop) on top of each other. That's where you come in... you're mission... should you choose to accept it... is to... figure out where my brain is failing... can you simplify it?,,, change controllers?
lance.81922
2005-05-14, 06:11 PM
I'll test it for you, but let one of the other local hotshots edit your code. I write plenty of my own, and don't particularly enjoy editing somebody else's. You know, you find something that doesn't work right, spend some time fixing little stuff to get it to work right, discover more stuff that contributes to the problem, which then turns up more convoluted stuff. Eventually you just want to start over. I'm not saying that none of your code is any good, but just that I haven't yet figured out how it does what it does. Figuring out how somebody else does things can be educational, but it can be very time consuming.
Poorest Chump
2005-05-14, 06:46 PM
Like I said in the beginning of this whole mess...
I'm pretty sure nobody has time to check my sloppy work.... Oh well, I tried... ...:(
kennet.sjoberg
2005-05-15, 12:24 AM
Like I said in the beginning of this whole mess...
Oh well, I tried... ...:(Is this what You expect ? ( click on the Attached Thumbnail )
I send You also a reformatted lisp file, minus ~100 lines.
I would recommend You to split the whole file and then reassemble it
with a working piece after piece. It is very hard to handle a long "jumping code".
And it would be nice with a little bit of explaining text that belongs to the subroutines.
: ) Happy Computing !
kennet
Poorest Chump
2005-05-15, 02:17 AM
I don't know what to say... I'm all teary-eyed... I think you're on to something here... organization... Wow, that's kindof a new concept to me... Thanks. I didn't really do anything with it yet but it looks like it'll help a great deal... does/will it work?.................
kennet.sjoberg
2005-05-15, 08:01 PM
. . . will it work? . . .
I don't know, I don't either know what the program would do ( if it works ).
: ) Happy Computing !
kennet
Poorest Chump
2005-05-19, 11:38 PM
I still can't figure it out... damit.
OK here's the deal. Say you've got a dwg. w/50 pipe spools on it. You've got 2", 3" and 4" pipe. You want to know how many sticks of 20' long 2", 3" and 4" pipe you need to minimize the amount of waist (drop). I (and the shop) want to know which pieces need to be cut out of which sticks (so the shop & I are on the same page).
I find the longest piece, assign it to a stick of pipe (pc1) and go back and "getanother" "longitem" (nextlongest) piece and see if it can be added to the same stick. If not, I stick it in a new selection set (ssrest). The trouble with THIS routine is the logic. How do I simplify (and eliminate all the code jumping)
ANYBODY?
HELP!!!!!!!!!!!!!! (if you want to, you may want to use Kennet's cleaner version above)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.