Jump to content

LISP to check if the polyline is in the centre of 2 polylines/lines


Recommended Posts

Posted
I'll have a look-see tomorrow dude :)

 

Thanks bro :)

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

  • vernonlee

    25

  • 7o7

    8

  • pBe

    6

  • hanhphuc

    3

Top Posters In This Topic

Posted Images

Posted (edited)

i have an idea: dynamic slide method but i just feel not so user friendly for multiple also a bit laggy.

 

make sure you have 4 sub-functions:

1.LM:uniquefuzz

2.split

3.hp:touch

4.hp:cursnap


;*This sub function coutesy of sir Lee Mac
(defun LM:uniquefuzz ( lst fuzz ) 
   (if lst
     (cons (car lst)
       (LM:uniquefuzz
         (vl-remove-if '(lambda ( x ) (equal x (car lst) fuzz)) (cdr lst)) fuzz
       )
     )
   )
 )

;;;[color="red"]sub-function hp:cursnap download link:[/color]
;;;http://www.theswamp.org/index.php?topic=47603.msg526362#msg526362

;;;http://www.cadtutor.net/forum/showthread.php?88011-LISP-to-check-if-the-polyline-is-in-the-centre-of-2-polylines-lines/page3
(defun hp:touch (op i j _os fuzz / lst o catch ve [color="red"]oops[/color]) ;hanhphuc 24/08/14
 (setq	ve (mapcar ''((e) (vlax-ename->vla-object e)) (list i j))
fuzz (if (not fuzz)  <--- *optional: this can be omited if for single output unless using [color="red"]LM:uniquefuzz[/color]
       0.0 ; <-- ditto
       fuzz ; <-- ditto
       ) ;_ end of if <-- ditto
) ;_ end of setq
 (terpri)
 (if (and i j)
   (hp:cursnap
     op
     _os
     10.
     '(progn
(if
 (and ve (listp *cursor_ip*))
 (progn
  (apply
   'vla-move
   (cons (cadr ve) (mapcar ''((p) (vlax-3d-point (trans p 1 0))) (list p1 *cursor_ip*)))
   )
  (setq
   catch
   (vl-catch-all-apply
    ''((u v)
       (setq
	lst
	(split (vlax-safearray->list (variant-value (vla-IntersectWith u v 0))) 3 nil)
	)
       ) ;_ end of lambda
    ve ;(list a b)
    ) ;_ end of vl-catch-all-apply
   p1
   *cursor_ip*
   ) ;_ end of setq
  ) ;_ end of progn
 ) ;_ end of if
(if
 (< (length lst) o)
 (princ "\n")
 (princ "\r")
 ) ;_ end of if
(if
 (vl-catch-all-error-p catch)
 (progn
 (redraw (vlax-vla-object->ename(car ve)) 4)
 (vla-put-color (cadr ve) 256)
  )
  
 (progn
;;;        (setq [color="red"]oops[/color] (cons lst oops)) ; <---- *for multiple points un-comment this
  (redraw (vlax-vla-object->ename(car ve)) 3)
(mapcar ''((c) (cond((= (length lst) c) (vla-put-color (cadr ve) c) )))
'(1 2 3 4 5 6))
  ) ;_ end of progn
 ) ;_ end of if

(setq o (length lst))

)
    t
     );_ end of hp:cursnap
   ) ;_ end of if
 (redraw (vlax-vla-object->ename(car ve)) 4)
lst  ;<--- single output
;; (apply 'append ([color="red"]LM:uniquefuzz oops fuzz[/color])) ;<---- *for multiple points un-comment this
 ) ;_ end of defun


;sub function: split
;http://www.cadtutor.net/forum/showthread.php?87320-Break-a-list-in-two-sub-lists&highlight=Split+list
;hanhphuc 
(defun split (lst len opt / ls l i) ; opt, T= by division or nil=by length
(setq i 1 l '() len (if opt (/ (length lst) len) len))
 (while lst
   (setq l (append  l (list(car lst))))
   (if
   (zerop (rem i len))
(setq ls (cons l ls) l nil)
   ) 
   (setq i (1+ i) lst (cdr lst))
 ) ;_ end of foreach
 (if l
   (append (reverse ls) (list  l))
   (reverse ls)
 ) ;_ end of if
) ;_ end of defun

TOUCH.gif

using CIRCLE color to differentiate touching point

red= 1

yellow = 2

green = 3

cyan = 4

blue = 5

magenta = 6 (max)

 

ie: if red it means (1 touching inters point) the wall just fit the half width

if yellow means (2 touching inters points) if yellow along parallel it means wall

but yellow at corner then its OK which means 2 points touch at right angle

if white means no touching or Wall > half width (wider)

 

TEST:

(defun c:test (/ lst p1 p2 e c)
 (if (and (setq e (car (entsel "\nPick Side Wall.. ")))
   (setq p1 (cdr (assoc 10 (entget e))))
   (setq p2 (getpoint p1 "\nHalf width.."))
   (setq c (entmakex (mapcar 'cons '(0 10 40) (list "CIRCLE" p1 (distance p1 p2)))))
   ) ;_ end of and
  (hp:touch p2 e c "_nea" 0.0001) ;_ end of hp:touch
   ) ;_ end of if
 (entdel c) ; [color="red"]<---- you can delete this line in case you wanna "MARK" at where width is not fit, ie: circle is the Marker to lighlight [/color]
 ) ;_ end of defun

Edited by hanhphuc
multiple output: LM:uniquefuzz ,variable:fuzz, oops
Posted (edited)
i have an idea: dynamic slide method but i just feel not so user friendly for multiple also a bit laggy

 

using CIRCLE color to differentiate touching point

red= 1

yellow = 2

green = 3

...

magenta = 6 (max)

 

ie: if red it means (1 touching inters point) the wall just fit the half width

if yellow means (2 touching inters points) if yellow along parallel it means wall

but yellow at corner then its OK which means 2 points touch at right angle

if white means no touching or Wall > half width (wider)

 

Thanks for your consideration.

 

Is this a autocad command?

 

However this still needs to be done manually for every line.

 

I need something to determine quickly without doing 1 by 1.

 

For reference, My current method ( 1 by 1) is to use the command DI.

1) Enter "DI", bring the cursor to 1 end of the centre line and click 1 of the end point

2) Then move the cursor perpendicular (by pressing PER) to the wall line. The dimension will appear near the cursor.

3) I then move the cursor perpendicular to the other side of the wall. The dimension will again appear. If it is the same as the 1st side of the wall then I know the center line is center between the wall

4) I then repeat this to the midpoint & the other end of the center line, cause sometimes 1 end may be in the center but the end can be not. (Why it is crooked, I also not sure as both drawings are not done by me)

 

This is the fastest 1 by 1 method i can think of

 

Thanks for your suggestion though.

 

I am still open to ideas even if it meant manually 1 by 1 but at least faster then my current method.

 

Thanks

Edited by vernonlee
Posted

 

Overlooked your post.

 

Thank for the advise.

 

I have actually previously tested them briefly before.

 

The 1st one i feel is unsuitable to my current issue as that measures the length of a line , if i am not mistaken.

 

The 2nd basically draws a center line. This would be helpful if i am starting from scratch.

 

That said, i do think i can use the 2nd option currently (if the center line is too crooked & i need to redraw) if only it does polylines.

 

I tested on polyline & it gave me this error

 

Select object: ; error: bad argument type: 2D/3D point: nil

 

On a side note, Anyone know how to make that lisp work on polylines?

 

Thanks

Posted

Try this.

First, choose an object of center wall (in order to get its layer, because you have many different layers and this lisp only check one layer at a time).

Second, select all center wall you want to check. Which doesn't match your critea will be highlighted.

But one thing to be sure, the outer wall is not block or xref (you have to explode them first).

(defun c:cent(/ a ss ss0)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
  l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
	     (equal (car l1) (last l1) 0.001))
	 (mapcar 'list l1 (append (cdr l1) (list (car l1))))
	 (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp)
   (setq n 1)
   (while (and (setq ss1 (ssget "F" (list (setq mp (midp pt1 pt2))
                                   (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))))
	(< (sslength ss1) 2))
     (setq n (1+ n))
   )
   (ssdel v ss1)
   (distance mp (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
 )
 
 (defun getdis(pt1 pt2 v)        
   (if (not (equal (rtos (oneside pt1 pt2 v +) 2 0) (rtos (oneside pt1 pt2 v -) 2 0)))
     (ssadd v ss0))
 )
 
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
ss0 (ssadd)
ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)

Posted
Try this.

First, choose an object of center wall (in order to get its layer, because you have many different layers and this lisp only check one layer at a time).

Second, select all center wall you want to check. Which doesn't match your critea will be highlighted.

But one thing to be sure, the outer wall is not block or xref (you have to explode them first).

(defun c:cent(/ a ss ss0)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
     l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
            (equal (car l1) (last l1) 0.001))
        (mapcar 'list l1 (append (cdr l1) (list (car l1))))
        (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp)
   (setq n 1)
   (while (and (setq ss1 (ssget "F" (list (setq mp (midp pt1 pt2))
                                      (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))))
       (< (sslength ss1) 2))
     (setq n (1+ n))
   )
   (ssdel v ss1)
   (distance mp (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
 )
 
 (defun getdis(pt1 pt2 v)        
   (if (not (equal (rtos (oneside pt1 pt2 v +) 2 0) (rtos (oneside pt1 pt2 v -) 2 0)))
     (ssadd v ss0))
 )
 
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
   ss0 (ssadd)
   ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)

 

Thanks bro.

 

Tried it out on the drawing i previously attached. I got an error:

 

Command: CENT

Choose a polyline of center wall:

Select objects: Specify opposite corner: 8 found

Select objects:

; error: bad argument value: AcDbCurve 44

Command:

Posted

Did you explode the outer wall? that error is because it catched a block instead of a polyline.

Posted
Did you explode the outer wall? that error is because it catched a block instead of a polyline.

 

Let me check when I am back in the office tomorrow. Thanks bro.

Posted
Did you explode the outer wall? that error is because it catched a block instead of a polyline.

 

Hi bro.

 

Tested it.

 

Exploded the block to polylines.

 

After the command, there some center lines being highlighted, based on the wall type that was early selected at the start of the command.

 

But the resultant highlighted center lines is inconsistent. They are a mix of center & not center to the walls.

 

Thanks.

 

P/S

Just a note, When i have only 1 center wall layer, at the start of the command to select which center line type, the command gets stuck & somehow hang the autocad.

Posted

I never had a chance to get back to this request vernonlee, hanhphuc posts/idea looks promising. what do you make of it? and 7o7s'?

Posted
I never had a chance to get back to this request vernonlee, hanhphuc posts/idea looks promising. what do you make of it? and 7o7s'?

 

I have have tested both.

 

7o7s - I have responded in my previous post.

 

hanhphuc - I have also tested it much earlier. I definitely appreciate that lisp however it may not be practical ( no offense hanhphuc) in my current work load that need checking many walls. My attached sample is around 2.5% of my 1 single drawing. I have 30 more such dwg coming soon after some other adhoc work my boss pass to me.

 

I require something like 7o7s' idea that can highlight all center lines that are not center, but the walls selected are quite random - there is a mix of center lines that are center & some are not. Awaiting for his feedback on his lisp.

 

I also hope that you can look into it. Thanks.

Posted

I fixed the lisp to prevent pending Acad (because when it catch no outer wall it will find foerever).

Addition to highlighting, lisp draws 2 dimension at where center line is not centered. You can use undo command to erase those dimensions afterward.

(defun c:cent(/ a ss ss0)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
  l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
	     (equal (car l1) (last l1) 0.001))
	 (mapcar 'list l1 (append (cdr l1) (list (car l1))))
	 (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp mp1)
   (setq n 1
  mp (midp pt1 pt2))
   (while (and (setq ss1 (ssget "F"
	        (list mp (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))))
	 (< (sslength ss1) 2)
	 (< n 5))
(setq n (1+ n))
   )
   (ssdel v ss1)
   (list mp (setq mp1 (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
  (distance mp mp1))
 )
 
 (defun getdis(pt1 pt2 v / tm1 tm2)        
   (if (not (equal (rtos (last (setq tm1 (oneside pt1 pt2 v +))) 2 0)
	    (rtos (last (setq tm2 (oneside pt1 pt2 v -))) 2 0)))
     (progn
(ssadd v ss0)
(command "dimlinear" (car tm1) (cadr tm1) (car tm1))
(command "dimlinear" (car tm2) (cadr tm2) (car tm2))
     )
   )
 )
 (command "undo" "be") (setvar 'cmdecho 0)
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
ss0 (ssadd)
ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (command "undo" "e") (setvar 'cmdecho 1)
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)

Posted
I fixed the lisp to prevent pending Acad (because when it catch no outer wall it will find foerever).

Addition to highlighting, lisp draws 2 dimension at where center line is not centered. You can use undo command to erase those dimensions afterward.

(defun c:cent(/ a ss ss0)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
     l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
            (equal (car l1) (last l1) 0.001))
        (mapcar 'list l1 (append (cdr l1) (list (car l1))))
        (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp mp1)
   (setq n 1
     mp (midp pt1 pt2))
   (while (and (setq ss1 (ssget "F"
               (list mp (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))))
        (< (sslength ss1) 2)
        (< n 5))
   (setq n (1+ n))
   )
   (ssdel v ss1)
   (list mp (setq mp1 (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
     (distance mp mp1))
 )
 
 (defun getdis(pt1 pt2 v / tm1 tm2)        
   (if (not (equal (rtos (last (setq tm1 (oneside pt1 pt2 v +))) 2 0)
           (rtos (last (setq tm2 (oneside pt1 pt2 v -))) 2 0)))
     (progn
   (ssadd v ss0)
   (command "dimlinear" (car tm1) (cadr tm1) (car tm1))
   (command "dimlinear" (car tm2) (cadr tm2) (car tm2))
     )
   )
 )
 (command "undo" "be") (setvar 'cmdecho 0)
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
   ss0 (ssadd)
   ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (command "undo" "e") (setvar 'cmdecho 1)
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)

 

 

Hi bro. Tested it & i have this error.

 

Choose a polyline of center wall:

Select objects: Specify opposite corner: 6 found

Select objects: ; error: unable to get ObjectID: nil

 

 

:(

 

I have already exploded the blocks to polylines.

Posted (edited)

Sorry, change to this:

(defun c:cent(/ a ss ss0 prec1)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
  l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
	     (equal (car l1) (last l1) 0.001))
	 (mapcar 'list l1 (append (cdr l1) (list (car l1))))
	 (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp mp1)
   (setq n 1
  mp (midp pt1 pt2))
   (while (and (setq ss1 (ssget "F" (list mp (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))
			 '((0 . "*LINE")) ))
	 (< (sslength ss1) 2)
	 (< n 5))
(setq n (1+ n))
   )
   (if (ssmemb v ss1) (ssdel v ss1))
   (if (> (sslength ss1) 0)
     (list mp (setq mp1 (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
  (distance mp mp1))
     nil
   )
 )
 
 (defun getdis(pt1 pt2 v / tm1 tm2)
   (if (and (setq tm1 (oneside pt1 pt2 v +))
     (setq tm2 (oneside pt1 pt2 v -))
     (not (equal (rtos (last tm1) 2 prec) (rtos (last tm2) 2 prec))))
     (progn
(ssadd v ss0)
(command "dimlinear" (car tm1) (cadr tm1) (car tm1))
(command "dimlinear" (car tm2) (cadr tm2) (car tm2))
     )
   )
 )
 
 (command "undo" "be") (setvar 'cmdecho 0)
 (setq prec1 (getint (strcat "\nPrecision <" (rtos (if (not prec) (setq prec 0) prec)) ">:")))
 (if prec1 (setq prec prec1))
 (setq prec (fix prec))
 (setvar 'dimdec prec)
 
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
ss0 (ssadd)
ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))  
 
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (command "undo" "e") (setvar 'cmdecho 1)
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)


Edited by 7o7
Posted (edited)
Sorry, change to this:

(defun c:cent(/ a ss ss0)
 (vl-load-com)
 (defun midp(d1 d2) (polar d1 (angle d1 d2) (* 0.5 (distance d1 d2))))
 (defun getp(v / l1)   
   (setq l1 (mapcar 'cdr (vl-remove-if-not '(lambda(x) (= (car x) 10)) (entget v)))
     l1 (if (or (= 1 (cdr (assoc 70 (entget v))))
            (equal (car l1) (last l1) 0.001))
        (mapcar 'list l1 (append (cdr l1) (list (car l1))))
        (mapcar 'list l1 (cdr l1) )))
   l1
 ) 
 
 (defun oneside(pt1 pt2 v le / n ss1 mp mp1)
   (setq n 1
     mp (midp pt1 pt2))
   (while (and (setq ss1 (ssget "F" (list mp (polar mp (le (angle pt1 pt2) (* 0.5 pi)) (* n 100)))
                '((0 . "*LINE")) ))
        (< (sslength ss1) 2)
        (< n 5))
   (setq n (1+ n))
   )
   (if (ssmemb v ss1) (ssdel v ss1))
   (if (> (sslength ss1) 0)
     (list mp (setq mp1 (vlax-curve-getClosestPointTo (ssname ss1 0) mp))
     (distance mp mp1))
     nil
   )
 )
 
 (defun getdis(pt1 pt2 v / tm1 tm2)
   (if (and (setq tm1 (oneside pt1 pt2 v +))
        (setq tm2 (oneside pt1 pt2 v -))
        (not (equal (rtos (last tm1) 2 0) (rtos (last tm2) 2 0))))
     (progn
   (ssadd v ss0)
   (command "dimlinear" (car tm1) (cadr tm1) (car tm1))
   (command "dimlinear" (car tm2) (cadr tm2) (car tm2))
     )
   )
 )
 
 (command "undo" "be") (setvar 'cmdecho 0)
 (setq a (car (entsel "\nChoose a polyline of center wall:"))
   ss0 (ssadd)
   ss (ssget (list (cons 0 "LWPOLYLINE") (assoc 8 (entget a)))))
 (foreach v (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (mapcar '(lambda(x) (getdis (car x) (last x) v)) (getp v))
 )
 (command "undo" "e") (setvar 'cmdecho 1)
 (if (> (sslength ss0) 0) (sssetfirst nil ss0))
 (princ)
)

 

OMG bro.!! I did a brief test & It worked!! :shock::celebrate:

 

However the affected line was not highlighted (This is helpful to allow me to change the colour of the affected center lines)

 

Also, Just 1 minor item, if possible, could it detect base on 0.1mm decimal place?

I notice that it will only detect/dimension when it is out by 1mm. Those that is out by 0.1mm or 0.9mm is not detected.

 

Thanks

 

Can't thank you enough :notworthy:

Edited by vernonlee
Posted

... also hope that you can look into it. Thanks.

 

OMG bro.!! I did a brief test & It worked!!

 

No need for that now :lol:

 

kudos to 7o7

 

On another note:

 

@7o7

 

Suggestion:

You may want to edit/modify the code on your previous post, that way there's only one source then just point it out to the other forum members where the latest and greatest is at.

 

YES you can do that on this forum [modify previous posts]

Posted

@7o7, well done you solved it!! yeah OP is happy now :)

1. If the building is all right angle shape parallel to Grid, can we use grid rounding algorithm can solve multiple?

2. alternatively (need some advise @7o7 & pBE) pseudo explained:

command:measure (with block) -> ssget side both walls -> intersections+sorting -> vlax-curve+compare -> delete typical -> highlight with dimension / clouded etc..

Posted

@pBe : thanks for the suggestion, I will do it hereafter.

@vernonlee : I have repaired lisp to your lastest request and edit it at #34, you have to input the precision you want (number after the decimal point ). But I also wonder why you need such a precision (0.1mm) in building drawing? One more thing, it does highlighted, check it.

@hanhphuc : Your ideas is great, but I can't imagine how to put it into lisp routine, it seems difficult!!

Posted
@vernonlee : I have repaired lisp to your lastest request and edit it at #34, you have to input the precision you want (number after the decimal point ). But I also wonder why you need such a precision (0.1mm) in building drawing? One more thing, it does highlighted, check it.

!

 

The precision of 0.1 is more for precaution & protection for myself, so that no one can fault me for not having it equal.

 

I have not work on my this project yet as I am doing some other work. But when i come to it, I will post a feedback on it.

 

Honestly, no words can descript my gratitude so :notworthy::notworthy::notworthy:

  • 2 weeks later...
Posted

Hi 7o7,

 

I started back on that task last friday. But unfortunately there were this errors & also no dimension came out or lines highlighted

 

Command: CENT

undo Current settings: Auto = On, Control = All, Combine = Yes, Layer = Yes

Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] : be

Command:

Precision :

 

Choose a polyline of center wall:

Select objects: Specify opposite corner: 0 found

 

Select objects: Specify opposite corner: 0 found

Select objects: Specify opposite corner: 832 found, 832 total

 

Select objects: ; error: bad argument type: lselsetp nil

I made sure there were no blocks as well.

 

I also tested by copying a small part of my actual work dwg into my previous attachement & match to that layers, strangely, 2 dimension came appeared but did not pick up other not centered lines.

 

(Is the lisp tied to any specific layer name?)

 

There was also this error:-

 

Precision :

 

Choose a polyline of center wall:

Select objects: Specify opposite corner: 44 found

 

Select objects:

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

 

Too many objects selected for INTERSECT

; error: bad argument type: lselsetp nil

Hope you can advise further.

 

Thanks

 

p/s

 

I will upload the file somet time tomorrow for easy reference.

 

Thanks

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