think I can pull it off??

Thinking of Micheal here mostly, but any opinion welcome.
I have been rewriting some of my lisp that draws windows, most of the
latest revisions were to incorporate default values that updated when I
drew something.
That was a large improvement over entering data each time, but....
I am feeling ambitious now.
How about writing an ASCII file, saved to the hard drive, and read in as
a variable which would be default values on steroids.
dotted pairs.....
A list which contains ALL the possible known numbers (like height &
width) cast in stone, and a recommended value for things like trim
width which varies.
Use dotted pairs like maybe ((width . 36)(height . 60)........) keyed to
the designator.
no, you idiot, not DOTTED pairs. just a generic association list. dots
are for pairs that have integer values in the first slot.
So a 30" x 60" casement hinged left might start something like this:
( (desig "C2650") (type "C") (width 30) (height 60) (trim_width 3.5)
(hinge "Y" "L") ..............)
use the assoc command to retrieve values and insert into the lisp I
already have that actually does the drawing.....
think I can get that typed in this weekend?
if I skip church?
get it up and running and I could create a master text file that would
be able to do doors, garage doors, cabinets.
this is getting more interesting the more I turn it over.
parametrically speaking.
Reply to
roy
Loading thread data ...
Typed is one thing, debugged is another.
Reply to
Michael Bulatovich
only too true.
as kindly old Prof Tolkien once offered, "the tale grew with the telling." as I ponder I keep getting more ambitious.
but I am knee deep in my review of association lists right now. car & cdr / cons v.s. list
I have created a bare bones association list and can manage extracting the data. will have to review readfile command. I am juiced.
I am just punching the keys between here and creating the association list that would feed all the data to an existing routine. ..........
coffee. more coffee.
:)
Reply to
roy
I've never yet tried to write to/read from a file.
Reply to
Michael Bulatovich
would you be money ahead to just make blocks of the windows? how many different types / sizes are there?
Reply to
longshot
I use a simple routine that draws windows in elevation to any size that I want with some control over the elements in them. In some work, window sizes are all custom, so blocks are to static and limiting.
Reply to
Michael Bulatovich
I used to write programs in basic that created drawings from basic information about the object, entered or stored in a file. The output was only dxf though.
Bob
Reply to
sycochkn
EXACTLY! I would have so many blocks that finding the right block would be more work than drawing from scratch.
Hit the wall this morning, I was hoping to use read-line feeding into setq, but it returns text.......
howsoever, there is a tutorial at afralisp.net that is being quite useful. I still think the odds are in my favor of getting done by Monday.
may miss some sleep.....
seems that dear old Kenny has moved on. many thanks to Kenny - for many years - good source of "stuff".
all hail David, and the brunette on the right. or the other right, I forget which.
Reply to
roy
it's not exactly convenient. but not as hard for me as error trapping, which you seem to have mastered.
NOT GOING TO MAKE IT.
but I beg pardon, the wife did not let me. she gave me (ugh!) work to do. billable time - elevations at 45º with half stone and rounded shutters. she did not want to draw that. hmmmm.
but I still might have made it since I "appropriated" some code from Kenny. the read-line returns a single line and treats it like a single word. Kenny's code parses for "," and separates the words from a comma deliminating file. but then he uses atof to convert to a real number. which is cool if you want only numbers. but I want an ordered list of ordered lists which would include ASCII - they use letters in designators too.
if atof would just go ahead and FAIL nicely, I would have an easy time of it. but no, it returns zero, which MIGHT be a good response...... hate that word "might" when writing a program. I like to be sure. :)
think I will swipe his character parser routine, or rather re-engineer it, so that it sets a flag when an non-digit is encountered. if the flag is set, keep it text. if the flag is clear, convert to real number.
but my play time was largely denied me, so I am not going to make my "deadline".
I have one routine I remember, which I use, that takes some data out of a file, most of which is in my title block, like client name and plot date, sheet size, number of pages, etc, and writes to a text file. then I cut & paste that snippet into the zip when I archive and when I send plot files to be printed.
handy.
Reply to
roy
You've clearly got me confused with some other Michael Bulatovich. I almost never bother with error handlers.
Reply to
Michael Bulatovich
I do have memory problems. some stray recollection was that you understood a question well enough to make an intelligent comment. which surpassed me.
I have downloaded and read some of your code for examples when I wanted to do something similar. no, it was not bogged down with error trapping.
write tight code in the first place and she runs. otherwise, not.
by the way, I am from southern Missouri, and I am quite fond of Walnut trees...... :)
partly talking to myself now, I am going to need to parse character by character to test whether the string will remain a string or be converted to a real number. but I think I can still use Kenny's basic routine. I nested the list statement with success to created a list that looks more like the DFX code I meant to imitate.
but WHILE loops long evaded my comprehenssion. and Kenny is good with them, and it is an effort to read through his work. but I am thinking I can add a conditional statement to control the atof function testing for an ASCII range.
in the process I think I learned something. the "\" character is WITHIN THE RANGE you have to include to get digits AND + & - for a number. you WILL need negative numbers, and "\" is in the range. any conversion that tests like I intend would either have to include this symbol or write just as much of a test to re-include it.
this is (maybe) why different programs treat "\" and "/" so differently. which is fun because of it's arcane nature. but it's just an educated guess.
Kenny's routine parses one "word" into any number of "words" based upon commas in the string. cool. but he always converted to reals. my test, I think, needs to be something like (not (< 45 (ascii x) 58))
I think.....
Reply to
roy
It's true that the more you anticipate errors when you write your code the less error handling is required, but I think I only messed with error handlers once or twice. If you've read my code then you know it's not the most economical, but is usually pretty easy to follow. I don't bother with error handlers because I'm usually the one running the routine, or it's someone sitting next to me. When they do the job, the thrill goes out of it for me. I've only done one or two dialog boxes too. Way too much trouble for most routines, IMHO.
Reply to
Michael Bulatovich
It's true that the more you anticipate errors when you write your code the less error handling is required, but I think I only messed with error handlers once or twice. If you've read my code then you know it's not the most economical, but is usually pretty easy to follow. I don't bother with error handlers because I'm usually the one running the routine, or it's someone sitting next to me. When they do the job, the thrill goes out of it for me. I've only done one or two dialog boxes too. Way too much trouble for most routines, IMHO.
I had a humble opinion once, but I had to give up something for Lent. think that was in '92.
confidence is so much more fun than that other thing.
I agree with you about the trouble writing dialog boxes, but I would still like to master it. 4:30 - have it up and running and it handles both text and numbers.
had one conditional test for digits, and one for the commas, and there was a glitch running both. took a while to see that.
that and I had a glitch when I had just "finished", and I lost my file. pretty much had to start over. faster the second time, like always. and a good thing, I finally figured out and used the WATCH box in Vlisp. real handy for debugging loops.
I would like to tighten it up just a little. the way he kept a counter for absolute placement in the string, and the counter for the number of characters BETWEEN commas, left me running the piece that appends to the file twice. once at every comma, and once at the end.
which makes sense, but I can cut out 10% of the code for redundancy if I use an OR in my test. &nbsp;&nbsp;&nbsp;&nbsp; I think..........
and besides, right now it reads (setq x (substr data (+ 1 (- count chrct)) (- chrct 1))) and it bugs me to add one just so I can subtract one. I think it will work if I just set chrct to 0 instead of to 1 in the first place. should look more like (setq x (substr data (- count chrct) chrct ))
cheers.
this is fun.
Reply to
roy

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.