Jump to content

Recommended Posts

Posted

@Lee Mac What you've done there it's a little bit complex.The connection element must be just a single line.

 

@alanjt Exactly what you've done to show you that imagine,but the lines inside the circles must not be visible.Basically the same thing with this minor aspect.No more visible lines inside the circles.

  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    11

  • alanjt

    9

  • dig

    9

  • ReMark

    4

Top Posters In This Topic

Posted Images

Posted
I can't give you a picture because i don't have enough posts to do it.

 

Please click the link in my signature.

Posted
@Lee Mac What you've done there it's a little bit complex.The connection element must be just a single line.

 

@alanjt Exactly what you've done to show you that imagine,but the lines inside the circles must not be visible.Basically the same thing with this minor aspect.No more visible lines inside the circles.

 

Perhaps if you explained yourself better you would be sorted by now.

Posted

Thank you cad64 for the info.

 

So that's what i need.There are no specifications about sizes.

Posted

Try this:

 

(defun c:cc ( / e1 e2 )
 ;; © Lee Mac  ~  23.05.10
 (vl-load-com)

 (if (and (setq e1 (car (entsel "\nSelect First Circle: ")))
          (eq "CIRCLE" (cdr (assoc 0 (entget e1)))))
   
   (while (and (setq e2 (car (entsel "\nSelect Next Circle: ")))
               (eq "CIRCLE" (cdr (assoc 0 (entget e2)))))
     
     (line (vlax-curve-getClosestPointto e2 (cdr (assoc 10 (entget e1))))
           (vlax-curve-getClosestPointto e1 (cdr (assoc 10 (entget e2)))))

     (setq e1 e2)
   )
 )
 (princ)
)

(defun line ( p1 p2 )
 (entmakex
   (list
     (cons 0 "LINE")
     (cons 10 p1)
     (cons 11 p2)
   )
 )
)

Posted

For multiple:

 

(defun c:ccm ( / ss )
 ;; © Lee Mac  ~  23.05.10
 (vl-load-com)

 (if (setq ss (ssget '((0 . "CIRCLE"))))
   (
     (lambda ( i / e1 e2 j )
       
       (while (setq j (1+ i) e1 (ssname ss (setq i (1+ i))))

         (while (setq e2 (ssname ss (setq j (1+ j))))

           (line (vlax-curve-getClosestPointto e2 (cdr (assoc 10 (entget e1))))
                 (vlax-curve-getClosestPointto e1 (cdr (assoc 10 (entget e2)))))
         )
       )
     )
     -1
   )
 )
 (princ)
)

(defun line ( p1 p2 )
 (entmakex
   (list
     (cons 0 "LINE")
     (cons 10 p1)
     (cons 11 p2)
   )
 )
)

Posted

As an aside, for the multiple connections program the number of connections for n circles will be the (n-1)th Triangle Number, or:

 

n(n-1)/2

 

Lee

Posted

The program doesn't work.I don't know why.After selecting the objects,the program doesn't return anything.It asks for objects continuously.

 

What about your last post?Where should i introduce that piece of code?

Posted

Both work for me, but I am done with this thread. If you can't get it to work, I'm sure other members will assist. I'm fed up with your attitude towards our voluntary help and so depart from continued participation in this thread.

 

ccm.gif

cc.gif

Posted

I really don't know what is the problem with the last two codes.The other code posted by you works properly but these two don't.

I think that i already mentioned that i am a newbie in Lisp.I really don't know the reason why are you so pissed,because all i wanted to know was the code for this problem.I didn't flame anybody,i was just hoping to get something from you.I know that is called voluntary help and i'm sorry that i waste your time with my "garbbage".Thank you anyway Lee.,and i hope that somebody can help me with my problem

Thanks !

Posted

I suppose I was just getting irritated with how the thread wasn't really 'progressing'.

 

It could be that the Visual LISP functions weren't loaded - most of us have (vl-load-com) in the ACADDOC.lsp, so we don't notice if its missing. I have updated the codes to account for this, please try them.

Posted

Now the codes are working just fine.

 

Thank you Lee and thank you everybody for your support.

Posted

I'm surprised it didn't throw an error before, but glad its working now.

Posted

BTW, you might be interested to see here - I took the routine a bit further.

 

You may have to become a member first to see it though :(

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...