< .... >
Yeah, but Kerry is right. I should have been helping, not giving you the answer.
No problem Alan.
I've just about accepted that the expectation of instant gratification is killing the learning process.
You're absolutely correct. I should have made suggestions instead of just giving the code. I know you guys were good enough to teach me when I first got here.
Well guys, first off, I have a mindset to learn more by example. So the code Alan threw out was hasty, but I have learned from it. You see, when one doesn't know what to look for, it's pretty difficult to learn from hints:
Hint :
What is ss. "
What is selLine. "
What are you trying to find the "_MID" of ?
Although in this case, I already knew what it was I was looking for, I just didn't know in what format it was to happen.
I have a selection set:
...
And I want to drop a block on the midpoint of the line in the selection set.
How can I get the midpoint of the line in the selection set ??
So, I did learn from Alan's code, but I didn't use it. I'm acually still learning how Lambda & mapcar works.
Here's what I ended up doing:
(setq selLine (ssname Lines 0) ; get first line in selection
LineBeginPT (cdr (reverse (cdr (reverse (assoc 10 (entget selLine))))))
LineEndPT (cdr (reverse (cdr (reverse (assoc 11 (entget selLine))))))
LineBeginX (car LineBeginPT)
LineBeginY (car (cdr LineBeginPT))
LineEndX (car LineEndPT)
LineEndY (car (cdr LineEndPT))
LineMidX (/ (+ LineBeginX LineEndX) 2.0)
LineMidY (/ (+ LineBeginY LineEndY) 2.0)
LineMidPT (append LineMidPT (list LineMidX) (list LineMidY) (list Z))
)
A lengthy way to go about it, but it's what I know at the moment. It was this: (lambda (a b) (/ (+ a b) 2.))) that sparked my memory.
Now I have seen this before, but I couldn't remember how it was formatted:
(command "_.line" "_mid" (cadr (entsel)))
This is actually what I was looking for, or more precisely, this: (cadr (entsel)))
So I Thank you guys, for you interest in helping me learn by asking questions, for your hastiness in just throwing out code, and for your concern in how things are learned. To me you guys are like gods, the masters of LiSP and I do respect your thoughts and comments. I do want you to know I am not trying to brown nose and I'm just looking for someone to write code for me. I enjoy writing it and learning it.
With that said, what are you Se7en, referring to when you mentioned:
...
And obviously the "proper use of a subject line" process as well (no one will ever have this problem and they certainly wont need to search for it in the future either).
Please advise if I have not followed protocol or have haphazardly posted my subject line inproperly. I would really like to know what the proper procedure is.
I have read that when writing code, it is a good practice to put comments at then end of a line of code or just after the line of code to remind yourself or someone else who may be editing the code, what your intentions were at the time the code was written and what the code is doing. I am trying to put that into practice, and am learning that many practices I have may be unorthodox and haphazardly done. So I appreciate these comments and would like to know what your intentions and understanding is in posting the comment.
Thanks.