Anwendung der Erzeugung einer Id für jedes Element
This commit is contained in:
@@ -596,6 +596,10 @@
|
||||
|
||||
;; 0. Attribute aus der Quell-.dwg lesen (vor ssg-start, da eigene INSERT/ERASE)
|
||||
(setq srcAttribs (ssg-attrib-read-dwg (strcat *block-path* blockname ".dwg")))
|
||||
;; ID-Attribut hinzufuegen falls noch nicht vorhanden
|
||||
(if (and srcAttribs (not (assoc "ID" srcAttribs)))
|
||||
(setq srcAttribs (append srcAttribs (list (cons "ID" ""))))
|
||||
)
|
||||
(if (null srcAttribs)
|
||||
(progn (princ "\n[OMNI] Keine Attribute im Quell-Block gefunden.") nil)
|
||||
(progn
|
||||
@@ -711,6 +715,11 @@
|
||||
(entmod ed)
|
||||
(entupd textEnt)
|
||||
|
||||
;; Eindeutige ID zuweisen
|
||||
(if (and blockEnt (atoms-family 1 '("ssg-id-generate")))
|
||||
(ssg-id-generate blockEnt)
|
||||
)
|
||||
|
||||
(princ (strcat "\n[OMNI] " bname " eingefuegt. Laenge=" laengeStr " mm"))
|
||||
(setq ok T)
|
||||
)
|
||||
@@ -947,7 +956,7 @@
|
||||
;; hoehe = Hoehe in mm als String (wird als HOEHE-Attribut gesetzt)
|
||||
;; drehung = Drehwinkel in Grad als String (Block-Rotation)
|
||||
;; Rueckgabe: Einfuegepunkt oder nil bei Abbruch
|
||||
(defun omni:insert-dxf (sivasnr-str hoehe drehung / dxf-pfad data-pfad pt angleDeg blockEnt)
|
||||
(defun omni:insert-dxf (sivasnr-str hoehe drehung / dxf-pfad data-pfad pt angleDeg blockEnt attribs layer-name)
|
||||
(setq data-pfad (getenv "DXFM_DATA"))
|
||||
(if (null data-pfad)
|
||||
(progn
|
||||
@@ -980,16 +989,35 @@
|
||||
|
||||
(setq blockEnt (entlast))
|
||||
|
||||
;; HOEHE und DREHUNG Attribute setzen
|
||||
(if (and blockEnt (= (cdr (assoc 0 (entget blockEnt))) "INSERT"))
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" (if drehung drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))))
|
||||
(progn
|
||||
;; HOEHE und DREHUNG Attribute setzen
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" (if drehung drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))))
|
||||
|
||||
;; Layer aus LAYER-Attribut lesen und Block verschieben
|
||||
(setq attribs (ssg-attrib-read blockEnt))
|
||||
(setq layer-name (cdr (assoc "LAYER" attribs)))
|
||||
(if (and layer-name (> (strlen layer-name) 0))
|
||||
(progn
|
||||
(ssg-make-layer layer-name 7 nil)
|
||||
(entmod (subst (cons 8 layer-name) (assoc 8 (entget blockEnt)) (entget blockEnt)))
|
||||
(entupd blockEnt)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; Eindeutige ID zuweisen
|
||||
(if (and blockEnt (atoms-family 1 '("ssg-id-generate")))
|
||||
(ssg-id-generate blockEnt)
|
||||
)
|
||||
|
||||
(princ (strcat "\n[OMNI] " sivasnr-str " eingefuegt."
|
||||
" Hoehe=" (if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000"))
|
||||
" Drehung=" (if drehung drehung (ssg-cfg-or "omniflo" "default_drehung" "0"))))
|
||||
" Drehung=" (if drehung drehung (ssg-cfg-or "omniflo" "default_drehung" "0"))
|
||||
(if layer-name (strcat " Layer=" layer-name) "")))
|
||||
(ssg-end)
|
||||
pt
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user