Message 1 of 30
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
It's possible connect all selected blocks with a polyline but without going over a polyline.?
Solved! Go to Solution.
It's possible connect all selected blocks with a polyline but without going over a polyline.?
Solved! Go to Solution.
@3wood wrote:Something like this?
yes. something like that (in images). I can not make work that file, that vlx file just shows me next window:
...but I need something like that vlx try do.
I attached a lisp routine that works 50% how I need it.
Here is an example of how it works:
...as you can you see some polylines are going over other polylines. What I need is fix that.
I attached 3 lisp-routines that could be useful to make a base
No big ideas in here...
(defun c:BConnectNoX (/ ss pts) (if (and (setq ss (ssget '((0 . "INSERT,CIRCLE,POINT")))) (setq pts (mapcar '(lambda (e) (cdr (assoc 10 (entget e)))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (setq pts (vl-sort pts (function (lambda (e1 e2) (< (cadr e1) (cadr e2)))))) (setq pts (vl-sort pts (function (lambda (e1 e2) (< (car e1) (car e2)))))) ) (entmake (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length pts)) (cons 70 0)) (mapcar (function (lambda (p) (cons 10 p))) pts)))) (princ) )
Interesting proposal.
apparently, work like Tcount.lsp:
there are more rules that I need add:
+the first rule, the blocks should be linked to the next nearest block no matter rotation or angle.
+the second rule, the LISP routine should work with dynamic blocks and regular blocks. (for some reason 20% of lisp routines that user does not work with dynamic block)
here an example using attached lisp routine (Connect_Blocks-all-option-by-dbhunia.lsp). red-polylines are what I need to fix.
file, where I tested it, is attached.
If you omit blocks and just consider their insertion points as points, it is a join the dots problem. The problem is Rule 1. It won't allow a solution in most random situations, if it must connect to the next nearest point.
Look at this thread. https://www.theswamp.org/index.php?topic=30434.0
I am not one of the robots you're looking for
the problem is with the next marked blocks...
if possible connect that blocks to their nearest block to their intersections, like this:
...final result should be like this. (connecting all point without going over other)
... final lisp should work with dynamic blocks and regular blocks.
@jtm2020hyo wrote:...final result should be like this. (connecting all point without going over other)
….
That image now violates the request in Message 1 to "connect all selected blocks with a polyline." You need to pin down more precisely what you really want to happen.
@dlanorh wrote:
If you omit blocks and just consider their insertion points as points, it is a join the dots problem. The problem is Rule 1. It won't allow a solution in most random situations, if it must connect to the next nearest point.
Look at this thread. https://www.theswamp.org/index.php?topic=30434.0
I was reading that post and I found that they are trying creating geometric figures. that should be a lot more hard to be created. I just need to connect all block or points (base point) without going over other polylines.
yes, you are right.
I just need to connect all points without going over other. no matter how or what to use.
@jtm2020hyo wrote:
yes, you are right.
I just need to connect all points without going over other. no matter how or what to use.
Have you seen >this topic< ?
@Kent1Cooper wrote:
@jtm2020hyo wrote:
yes, you are right.
I just need to connect all points without going over other. no matter how or what to use.
Have you seen >this topic< ?
Yes. I already tried but I need to create a link between the nearest blocks.
I tried to use the solution marked in that post but is not what I need, that gives me this:
edit: attached file where I tested your code.
Your LinkPoints look interesting, Can you fix your code? or maybe I'm doing something bad? I'm pretty interesting in try to test your code.
I found a lisp-routine that might help to solve this issue. (first attached)
"slbl2" auto-select blocks that are touching selected polylines. simply that.
exactly what we need. now we need to someone to combine it with "Connect_Blocks-all-option-by-dbhunia" lisp-routine. (attached below)