Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/20/2023 in all areas

  1. Dealing with mostly blocks at my old job here is what I have learned. Account for the basepoint of the old blocks vs the new blocks or things will shift. Use insert with the block name = filepath to new block to update the block definition and all blocks of that type in the drawing. (command "_.Insert" (strcat blkname "=" filepath) PT 1 1 0) everything i worked on was at 0 degrees but you might have to take that into account as well.
    1 point
  2. @Flacon Try to search about ODBX, lee mac has some tips Lee Mac ODBX
    1 point
  3. Here's one I use on a regular basis: (defun c:Clone (/ ent layer name) ;; Clone selected object's layer ;; Required subroutine: AT:GetString ;; Alan J. Thompson, 02.09.11 (setvar 'ERRNO 0) (if (while (and (not ent) (/= 52 (getvar 'ERRNO))) (initget 0 "Current") (setq ent (entsel "\nSelect object on layer to clone [Current]: ")) ) (cond ((not (setq name (AT:GetString "Specity clone layer name:" (setq layer (if (eq (type ent) 'STR) (getvar 'CLAYER) (cdr (assoc 8 (entget (car ent)))) ) ) ) ) ) ) ((not (snvalid name)) (alert "Invalid name!")) ((apply (function eq) (mapcar (function strcase) (list name layer))) (alert "Clone layer cannot have same name as base layer!") ) ((tblsearch "LAYER" name) (alert "Layer already exist!")) ((entmake (append (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 name) ) (vl-remove-if-not (function (lambda (x) (vl-position (car x) '(6 62 70 270 370)))) (entget (tblobjname "LAYER" layer)) ) ) ) (alert (strcat "Layer \"" layer "\" has been cloned to create layer: \"" (setvar 'CLAYER name) "\"" ) ) ) ) ) (princ) ) (defun AT:GetString (#Title #Default / #FileName #FileOpen #DclID #NewString) ;; Getstring Dialog Box ;; #Title - Title of dialog box ;; #Default - Default string within edit box ;; Alan J. Thompson, 08.25.09 (setq #FileName (vl-filename-mktemp "" "" ".dcl") #FileOpen (open #FileName "W") ) (foreach x '("TempEditBox : dialog {" "key = \"Title\";" "label = \"\";" "initial_focus = \"Edit\";" "spacer;" ": row {" ": column {" "alignment = centered;" "fixed_width = true;" ": text {" "label = \"\";" "}" "}" ": edit_box {" "key = \"Edit\";" "allow_accept = true;" "edit_width = 40;" "fixed_width = true;" "}" "}" "spacer;" ": row {" "fixed_width = true;" "alignment = centered;" ": ok_button {" "width = 11;" "}" ": cancel_button {" "width = 11;" "}" "}" "}//" ) (write-line x #FileOpen) ) (close #FileOpen) (setq #DclID (load_dialog #FileName)) (new_dialog "TempEditBox" #DclID) (set_tile "Title" #Title) (set_tile "Edit" #Default) (action_tile "accept" "(setq #NewString (get_tile \"Edit\"))(done_dialog)") (action_tile "cancel" "(done_dialog)") (start_dialog) (unload_dialog #DclID) (vl-file-delete #FileName) #NewString )
    1 point
×
×
  • Create New...