Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/16/2026 in all areas

  1. Select at start of what you need, then shift select the end is fastest I know (you can actually go from end to the beginning as well).
    2 points
  2. somehow a document type object lives along your copied_objects so try this : (defun c:new_desktop_file_copy ( / acad_dbx object_list zero_point db) (defun make_color_21 (/ layers) (setq layers (vla-get-layers acad_dbx)) (vlax-map-collection (vla-get-blocks acad_dbx) '(lambda (block) (vlax-map-collection block '(lambda (object) (vla-put-color object 256) (if (/= 21 (vla-get-color (setq layer (vla-item layers (vla-get-layer object))))) (vla-put-color layer 21)))) ) ) ) (setq acad_dbx (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (substr (getvar 'acadver) 1 2)))) (prompt "\nPick objects to copy to a new file on the desktop...") (setq object_list (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget)))))) (setq zero_point (getpoint "\nPick zero point for the copied entities: ")) (setq db (vla-get-database (vla-get-activedocument (vlax-get-acad-object)))) (foreach copied_object (setq odbx_objects_list (vlax-invoke db 'copyobjects object_list (vla-get-modelspace acad_dbx))) (if (vlax-method-applicable-p copied_object 'move) (vla-move copied_object (vlax-3d-point zero_point) (vlax-3d-point 0 0 0)) (princ (strcat "\nUnable to move object name : " (vla-get-name copied_object))) ) ) (make_color_21) (vla-saveas acad_dbx (princ (strcat (getenv "userprofile") "\\Desktop\\" (getstring "\nEnter file name: ") ".dwg"))) (vlax-release-object acad_dbx) (princ) )
    2 points
  3. @karfung, why not to do a Writeblock command, it allow to set units as need, and show zoom extend new block.dwg
    1 point
  4. @devitg Ok, try this. Now labels are fields. If you prefer simply Mtext, Ithink that you can change it (with previous code) mult-label_bearing.lsp
    1 point
  5. @SLW210 how to select all the code at code tags , like a short key ctrl+a or whatever
    1 point
  6. Maybe use (setvar 'hpname "User") in code, sets the pattern name.
    1 point
  7. @karfung see the new dwg new block.dwg
    1 point
  8. @karfung it seem to be you need to make a new.dwg , if so, you can use WRITEBLOCK acad command .
    1 point
  9. maybe first do an audit on this drawing
    1 point
  10. Does the LISP file load the Visual LISP ActiveX functions with (vl-load-com)? I don't see it in the code.
    1 point
  11. 1 point
×
×
  • Create New...