Any way to match text layer to hatch below?

Any way to match text layer to hatch below?

Anonymous
Not applicable
1,066 Views
5 Replies
Message 1 of 6

Any way to match text layer to hatch below?

Anonymous
Not applicable

Hello,

 

The challenge is:

 

I have multiple single text over multiple hatches, I need to match each text layer to the hatch under it.

 

Then, is there a way to create boundaries of multiple hatches (now on different layers) while each hatch boundary is on the equivalent hatch layer?

 

Thanks

 

 

0 Likes
Accepted solutions (1)
1,067 Views
5 Replies
Replies (5)
Message 2 of 6

dbhunia
Advisor
Advisor

Post sample drawing ....... with pointing out your points...


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 6

Anonymous
Not applicable

This should clears it.

Thank you anyways.

0 Likes
Message 4 of 6

dbhunia
Advisor
Advisor
Accepted solution

Try this..........Use CHHL.....

 

(defun c:CHHL (/ lst l1 ss Data DataT N N1)
(setvar 'cmdecho 0)
(princ "\nSelect Hatch...")
(setq selectionset (ssget '((0 . "HATCH"))))
(setq osm (getvar 'osmode))
(setvar 'osmode 0)
(repeat (setq N (sslength selectionset))
	(setq Data (ssname selectionset (setq N (- N 1))))
	(setq lst (Poly_Cor_Extr 10 (entget Data)))
	(setq l1 (remove-at lst (- (length lst) 1)))
	(setq l1 (remove-at l1 0))
	(setq ss (ssget "_CP" l1 '((0 . "TEXT"))))
	   (repeat (setq N1 (sslength ss))
		(setq DataT (ssname ss (setq N1 (- N1 1))))
		(entmod (subst (assoc 8 (entget DataT)) (assoc 8 (entget Data)) (entget Data)))
	   )
	(command "_pline")
	(while (= (getvar "cmdactive") 1 )
	(repeat (setq x (length l1))
		(command (nth (setq x (- x 1)) l1))
	)
	(command "C")
	)
	(entmod (subst (assoc 8 (entget Data)) (assoc 8 (entget (entlast))) (entget (entlast))))
)
(setvar 'osmode osm)
(setvar 'cmdecho 1)
(princ)
)
(defun Poly_Cor_Extr (key cor / val cor_list)
   (foreach val cor
	(if (eq key (car val)) (setq cor_list (cons (cdr val) cor_list)))
   )
(reverse cor_list)
)
(defun remove-at (lst pos / head)
  (repeat pos
     (setq head (cons (car lst) head)
           lst (cdr lst)
     )
  )
(append (reverse head) (cdr lst))
)

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 5 of 6

Anonymous
Not applicable

Hello,

 

Anyway to make this lisp ignore hatches that have no text above them? instead of stopping and throwing an error.

 

Thanks again, it was very helpful.

0 Likes
Message 6 of 6

dbhunia
Advisor
Advisor

Try this...

 

(defun c:CHHL (/ lst l1 ss Data DataT N N1)
(setvar 'cmdecho 0)
(princ "\nSelect Hatch...")
(setq selectionset (ssget '((0 . "HATCH"))))
(setq osm (getvar 'osmode))
(setvar 'osmode 0)
(repeat (setq N (sslength selectionset))
	(setq Data (ssname selectionset (setq N (- N 1))))
	(setq lst (Poly_Cor_Extr 10 (entget Data)))
	(setq l1 (remove-at lst (- (length lst) 1)))
	(setq l1 (remove-at l1 0))
	(if (/= nil (setq ss (ssget "_CP" l1 '((0 . "TEXT")))))
	    (progn
		(repeat (setq N1 (sslength ss))
		   (setq DataT (ssname ss (setq N1 (- N1 1))))
		   (entmod (subst (assoc 8 (entget DataT)) (assoc 8 (entget Data)) (entget Data)))
	   	)
	   	(command "_pline")
	   	(while (= (getvar "cmdactive") 1 )
	   	(repeat (setq x (length l1))
		   (command (nth (setq x (- x 1)) l1))
	   	)
	   	(command "C")
	   	)
	   	(entmod (subst (assoc 8 (entget Data)) (assoc 8 (entget (entlast))) (entget (entlast))))
	    )
	)
)
(setvar 'osmode osm)
(setvar 'cmdecho 1)
(princ)
)
(defun Poly_Cor_Extr (key cor / val cor_list)
   (foreach val cor
	(if (eq key (car val)) (setq cor_list (cons (cdr val) cor_list)))
   )
(reverse cor_list)
)
(defun remove-at (lst pos / head)
  (repeat pos
     (setq head (cons (car lst) head)
           lst (cdr lst)
     )
  )
(append (reverse head) (cdr lst))
)

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....