Insertovanje bloka (tačke ili bilo kojeg bloka koji napravite) na sredini linije

insertuje blok koji vi napravite na sredini svih linija koje označite.

iskopirajte kod dole u notepadu i sačuvajte dokument sa ekstenzijom .lsp

blok koji napravite nazovite "OVDE-NAZIV-BLOKA" ili izmenite taj tekst u lisp fajlu. Poziva se lispić komandom "Insert@MidLine"

 

 

(defun c:Insert@MidLine (/ js n ent dxf_ent)

(princ "\nSelect lines to insert block at middle")

(setq js (ssget '((0 . "LINE"))))

(cond

(js

(repeat (setq n (sslength js))

(setq

ent (ssname js (setq n (1- n)))

dxf_ent (entget ent)

)

(entmake

(list

'(0 . "INSERT")

'(100 . "AcDbEntity")

(assoc 67 dxf_ent)

(assoc 410 dxf_ent)

(assoc 8 dxf_ent)

(if (assoc 62 dxf_ent) (assoc 62 dxf_ent) '(62 . 256))

(if (assoc 6 dxf_ent) (assoc 6 dxf_ent) '(6 . "ByLayer"))

(if (assoc 48 dxf_ent) (assoc 48 dxf_ent) '(48 . 0.0))

(if (assoc 370 dxf_ent) (assoc 370 dxf_ent) '(370 . 0))

'(100 . "AcDbBlockReference")

'(2 . "OVDE-NAZIV-BLOKA")

(cons 10 (mapcar '* (mapcar '+ (cdr (assoc 10 dxf_ent)) (cdr (assoc 11 dxf_ent))) '(0.5 0.5 0.5)))

(if (assoc 39 dxf_ent) (assoc 39 dxf_ent) '(39 . 0.0))

'(41 . 1.0)

'(42 . 1.0)

'(43 . 1.0)

(cons 50 (angle (cdr (assoc 10 dxf_ent)) (cdr (assoc 11 dxf_ent))))

'(70 . 0)

'(71 . 0)

'(44 . 0.0)

'(45 . 0.0)

(assoc 210 dxf_ent)

)

)

)

)

(T (princ "\nNothing selected."))

)

(prin1)

)

Add comment


Security code
Refresh

Free Joomla! template by Age Themes