Jump to content

Recommended Posts

Posted
Just out of curiosity, what do you need the point value for? How are you going to use it?

 

We have a common symbol that is drawn at the end of multiple lines in a drawing. I guess similar to an arrow head. Its made from simple lines but can be tideous to draw. I used the distance command and assoc 10 and 11 from my line entity to calulate the end point closest to my selected point and have drawn my symbol from there.

 

Its mostly code found online modified with help from all the guys here, so thanks again all!

 

I have cheated a little bit with some text.. instead of creating new text style and new layer (they wont always exist) and added the text manually, I have inserted a block with the preset text already formatted and then exploded it. The beauty of doing it this way was it was very quick and easy to learn the code and the user gets to position the text while seeing the actual text on the screen, saving them moving it away from any objects after. Something I will try with proper code next time! :)

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    8

  • Se7en

    5

  • BlackBox

    5

  • alijahed

    4

Posted
Don't mind me, just playing around (because i can).

 

Sans Variable:

(
(lambda ( / )
  (while
    (not
      (eq "LINE"
          (cdr
            (assoc 0
                   (entget
                     (car (entsel "\nSelect Line: "))))))))
  (entget (entlast))
  )
)

 

Oops! Someone forgot about:

 

(entget nil)

 

 

Edit: Too funny, Lee... I'm busy copying your earlier post, while you post it again. :P

Posted
Oops! Someone forgot about:

 

 

who me? i didnt forget about anything (tread lightly, im in a crabby mood today).

Posted

The entsel and entlast will not be the same, but...

 

((lambda nil
  (while (not ((lambda (e) (and e (eq "LINE" (cdr (assoc 0 (entget e))))))
                (car (entsel "\nSelect line: "))
              )
         )
    (entget (entlast))
  )
)
)

Posted
We have a common symbol that is drawn at the end of multiple lines in a drawing. I guess similar to an arrow head. Its made from simple lines but can be tideous to draw. I used the distance command and assoc 10 and 11 from my line entity to calulate the end point closest to my selected point and have drawn my symbol from there.

 

 

Why not set an end snap? -David

Posted
We have a common symbol that is drawn at the end of multiple lines in a drawing. I guess similar to an arrow head. Its made from simple lines but can be tideous to draw. I used the distance command and assoc 10 and 11 from my line entity to calulate the end point closest to my selected point and have drawn my symbol from there.

 

Its mostly code found online modified with help from all the guys here, so thanks again all!

 

I have cheated a little bit with some text.. instead of creating new text style and new layer (they wont always exist) and added the text manually, I have inserted a block with the preset text already formatted and then exploded it. The beauty of doing it this way was it was very quick and easy to learn the code and the user gets to position the text while seeing the actual text on the screen, saving them moving it away from any objects after. Something I will try with proper code next time! :)

 

http://www.cadtutor.net/forum/showthread.php?48058-error-in-using-quot-entsel-quot&p=353716&viewfull=1#post353716

 

also...

 

(defun AT:ClosestEndPoint (entPnt)
 ;; Return closest end point on object
 ;; entPnt - List with object and point
 ;; Alan J. Thompson, 11.10.09
 (if (vl-consp entPnt)
   ((lambda (p)
      (car (vl-sort
             (list (vlax-curve-getStartPoint (car entPnt)) (vlax-curve-getEndPoint (car entPnt)))
             (function (lambda (a b) (< (distance p a) (distance p b))))
           )
      )
    )
     (trans (cadr entPnt) 1 0)
   )
 )
)

Posted

Responding in order (and in kind):

 

who me? ...

 

Yeah, you. o:)

 

... i didnt forget about anything...

 

How does knowingly posting a mistake help the OP (or anyone else reading this thread), my friend? :?

 

... (tread lightly, im in a crabby mood today).

 

I tread where I please. Don't be foolish enough to think you can tell me, or anyone else, otherwise. :roll:

 

I don't particularly care what 'mood' you're in; stop making your problem, our problem :twisted: ... You should really do something about your 'bad breath.' :P (Check my signature block for clarification)

 

We're all here to learn, dude. That kind of attitude isn't appreciated, and frankly doesn't belong here.

 

Otherwise, have a nice day! :D

 

PS - In case you wanted to know, I'm in such a great mood today, that I think I'm going to take my Fiancé to the pet store tonight and buy her a puppy!

Posted

PS - In case you wanted to know, I'm in such a great mood today, that I think I'm going to take my Fiancé to the pet store tonight and buy her a puppy!

Never a good idea.:wink:

Posted
Never a good idea.:wink:

 

Alan, my friend, you always offer sound advice! (Ha, ha, ha! :lol:)

 

Actually, this pup would be #2... our *first* needs a friend, now that my Fiancé's graduated, and looking for a job. We want to finish the initial training, before she starts work. :D

Posted
Alan, my friend, you always offer sound advice! (Ha, ha, ha! :lol:)

 

Actually, this pup would be #2... our *first* needs a friend, now that my Fiancé's graduated, and looking for a job. We want to finish the initial training, before she starts work. :D

ehh, no thank you. Granted, I'm the one with two children - both girls. :?
Posted
Responding in order (and in kind):

 

Yeah, you. o:)

 

How does knowingly posting a mistake help the OP (or anyone else reading this thread), my friend? :?

 

I tread where I please. Don't be foolish enough to think you can tell me, or anyone else, otherwise. :roll:

 

I don't particularly care what 'mood' you're in; stop making your problem, our problem :twisted: ... You should really do something about your 'bad breath.' :P (Check my signature block for clarification)

 

We're all here to learn, dude. That kind of attitude isn't appreciated, and frankly doesn't belong here.

 

Otherwise, have a nice day! :D

 

PS - In case you wanted to know, I'm in such a great mood today, that I think I'm going to take my Fiancé to the pet store tonight and buy her a puppy!

 

Since im pressed for time, I will make this short so hang on.

 

> posing "bad" code.

Why not? I told the OP to ignore the post. I was just playing around with the idea of doing it without using a variable. Obviously, if im going to do something without the use of variables (or the like) the use of the code will be limited at best. Hence my prefix to the post: "dont mind me, jut playing around".

 

> My mood your problem.

When did I make my mood your problem? When did I tell you about my problems? But to be precise, isn't that part of the idea behind a forum (people sharing problems in order to get them solved)?

 

> All here to learn

Nope. Obviously, some are here to be big fish in a small pond. You want learning, let me direct you down a path that I would take. I would lean towards the use of GRREAD instead of ENTSEL. Vladimir Nesterovsky has a method I would use--and have used--as a model for this task.

 

http://groups.google.com/group/comp.cad.autocad/browse_thread/thread/9918f72e96166965?

 

> Look at my signature

I dont care about signatures, avatars, or smiles I turn all that off (except for those stupid smiles--I hate those things-). That said; no, I will not look at your signature. Its bad enough that you forced me to look at 6 of those stupid smiles.

 

 

***

 

Am I an angry person? Nope.

Do I care if you get help? Yes, obviously, why else would I be here?

Will I hold your hand and make you feel all fuzzy inside while I solve your problems? No.

Have I been doing this a while? Yes.

 

Read this: [ http://www.catb.org/~esr/faqs/smart-questions.html ]. What was my code `bad'?

Posted (edited)
Since im pressed for time, I will make this short so hang on.

...

 

Relax. This is unnecessary, and rapidly approaching inappropriate. I'm not here to argue with you, or anyone else.

 

I never called your code 'bad', I simply pointed out that you made a mistake, and a *minor* one at that (something I often do personally).

 

In fact, because I took the time to credit Lee with his original statement of (entsel nil), he (Lee) beat me to it, in pointing out the *minor* mistake in your code.

 

Your code may have been posted in jest (and that's fine), but knowingly or not, it included a *minor* mistake, my friend. Admittedly, one in which Lee has personally corrected me of more than once (I'm a stubborn SOB).

 

"One who is offended by truth, has no place among those who seek wisdom" - Ah...Me

 

I often do the same as you have done here, and equally often receive some *minor* critique. There isn't a person here, or anywhere else, who is truly concerned by a humorous post. I encourage humor completely (as you've already commented on a similar post I made, in another thread).

 

Your co-authored website has loads of great information. I mean that sincerely. The amount of time it must have taken to compile that documentation is immense, to say the least. I'm glad you shared this resource, and I may refer to it in the future.

 

The easiest way I know to reconcile this tangent, is to ask that you please demonstrate your own principles (/opinions, etc.) now, and in public...

 

...

Courtesy never hurts, and sometimes helps

 

Be courteous. Use “Please” and “Thanks for your attention” or “Thanks for your consideration”. Make it clear you appreciate the time people spend helping you for free.

 

...

On Not Reacting Like A Loser

 

Odds are you'll screw up a few times on hacker community forums — in ways detailed in this article, or similar. And you'll be told exactly how you screwed up, possibly with colourful asides. In public.

 

When this happens, the worst thing you can do is whine about the experience, claim to have been verbally assaulted, demand apologies, scream, hold your breath, threaten lawsuits, complain to people's employers, leave the toilet seat up, etc. Instead, here's what you do:

 

Get over it. It's normal. In fact, it's healthy and appropriate.

 

...

Remember: When that hacker tells you that you've screwed up, and (no matter how gruffly) tells you not to do it again, he's acting out of concern for (1) you and (2) his community. It would be much easier for him to ignore you and filter you out of his life. If you can't manage to be grateful, at least have a little dignity, don't whine, and don't expect to be treated like a fragile doll just because you're a newcomer with a theatrically hypersensitive soul and delusions of entitlement.

...

 

 

I'd like to believe that we are both professionals, and that we can chalk this up to a misunderstanding.

 

Regardless, if you feel it necessary, I'd like to offer to continue this discussion in a separate thread (in the chat forum perhaps?), as this tangent is not relevant to the thread topic itself... having perused your website, I think you might prefer this over private messaging.

 

Otherwise, have a nice day! :D

Edited by BlackBox
Typo(s)
Posted

lmao: I am not Eric Steven Raymond.

I use the screen name "Se7en" because...well I use a screen name for several reasons that are not germane to this thread. However I will say that if you find out my real name (again, it is NOT Eric Steven Raymond), I ask you to just please refer to me by my screen name and not my real name; because using some ones real name when they purposely give a screen name is rude.

 

I dont mind you pointing out my mistakes, actually I prefer it because that means you're learning and using what I post, because there are usually quite a few mistakes in the code I post; part of my job is to write code. My company pays me to write code for them not you so I end up having to streamline, trim, remove, and etc. to post my code.

 

BTW, I am not worked up to relax.

Posted

BTW, you understand that, the "How To Ask Questions The Smart Way" document is for the question asker not the answer giver right?

Posted

Just for fun...

It cheats, but no defined variables.

((lambda (/)
  (while (vl-catch-all-error-p
           (vl-catch-all-apply
             (function
               (lambda (/)
                 (princ "\rSelect line: ")
                 ((lambda (e) (or (eq "LINE" (cdr (assoc 0 (entget e)))) (entget nil)))
                   (ssname ((lambda (gr) (cond ((eq 3 (car gr)) (ssget (cadr gr)))))
                             (grread T 15 2)
                           )
                           0
                   )
                 )
               )
             )
           )
         )
    (ssname (ssget "_P") 0)
  )
)
)

Posted
lmao: I am not Eric Steven Raymond.

...

However I will say that if you find out my real name (again, it is NOT Eric Steven Raymond), I ask you to just please refer to me by my screen name and not my real name; because using some ones real name when they purposely give a screen name is rude.

...

 

 

Thanks for the correction, Se7en. I have corrected my earlier post (Apologies to Eric S. Raymond!). Point taken regarding screen names; no offense intended.

 

...

I dont mind you pointing out my mistakes, actually I prefer it because that means you're learning and using what I post, because there are usually quite a few mistakes in the code I post; part of my job is to write code.

...

 

 

For clarity:

 

If one questions the use of a particular method in a code example I've posted, then one has learned something about my usage.

 

If one offers a correction to my code example (which proves to be correct), then I have learned something about my usage.

 

Otherwise, I share your sentiment.

 

 

BTW, you understand that, the "How To Ask Questions The Smart Way" document is for the question asker not the answer giver right?

 

 

Is there not a reasonable expectation, that the answer giver shall lead by example, as they too were once a question asker?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...