Jak to zapisać na poniższym przykładzie?
- Kod: Zaznacz cały
(defun c:pobierzatrybut ()
(setq XYZ (atof (cd:BLK_GetAttValueVLA (car (entsel)) "ATR1")))
(alert (rtos XYZ))
)
(defun c:pobierzatrybut ()
(setq XYZ (atof (cd:BLK_GetAttValueVLA (car (entsel)) "ATR1")))
(alert (rtos XYZ))
)
wilda napisał(a):Pobieram wartość atrybutu z bloku, ale jeżeli kliknę obok bloku (nie wybiorę bloku) to chcę wartość wpisać ręcznie.
Jak to zapisać na poniższym przykładzie?
- Kod: Zaznacz cały
(defun c:pobierzatrybut ()
(setq XYZ (atof (cd:BLK_GetAttValueVLA (car (entsel)) "ATR1")))
(alert (rtos XYZ))
)
(setq selection(car (entsel "\n Wybierz blok:")))
(if selection
(progn
(setq entlist(entget selection))
(if(= "INSERT"(cdr(assoc 0 entlist)))
(setq XYZ (atof (cd:BLK_GetAttValueVLA selection "ATR1")))
(progn ;jeżeli wybrano inny obiekt niż blok
(alert "to nie blok")
(setq XYZ (getreal "podaj XYZ"))
)
);if blok
);progn
(setq XYZ (getreal "podaj XYZ")) ;jeżeli nic nie wybrano
);if selection
(alert (rtos XYZ))
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników