+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default Can these commands be executed without dialog boxes?

    Registered forum members do not see this ad.

    I want to put this into a script. I need to select all instances of this block and change it's layer and linetype.

    I can't use a lisp since don't know programming.
    Attached Images

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,447

    Default

    Did you try searching for a lisp routine?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default

    That was my question: How to put this in a script.

  4. #4
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default

    I wouldn't necessarily know how to modify a lisp routine to make it work.

  5. #5
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,447

    Default

    Maybe someone has already written a lisp routine that will do what you want. Try a search.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  6. #6
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default

    I did. There are. The one I found selects a block and chages it's color. But since I am not a programmer I do not know how to modify the lisp.

  7. #7
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,447

    Default

    Why can't you just use the BEDIT command? Open the block in question in the block editor. Change it's layer and linetype via the Properties palette. When you close the block editor you'll be asked if you want to save your changes. Do so. When you pop back into your drawing all instances of the block will have been changed.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  8. #8
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default

    I have around 80 drawings with the same mistake.

  9. #9
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2008
    Posts
    52

    Default

    I found this thread but the lisp to select all blocks of a certain name doesn't work and I don't know how to code.

    http://www.cadtutor.net/forum/showth...-Command/page2

  10. #10
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    Registered forum members do not see this ad.

    Try this it has no error checking as it was done quick, read the comments to understand what its doing. I did test it, it does not change stuff on various layouts as you did not mention that. It could be used with a script to do all 80 dwg's in one go, I did not want to confuse you with how to do that also. A hint though open explorer to where you have the lisp saved just drag and drop onto dwg and it will start up straight away saving a few steps.

    Code:
    (defun c:reset-blk ( / ss newlay newlt bname)
    (vl-load-com)
    (setq obj (vlax-ename->vla-object (car (entsel "\nPick Block")))) ;pick an object and make it a Vl object
    (setq newlt (getstring "\nEnter linetype name Bylayer")) ; enter linetype name
    (setq newlay (getstring "\nEnter layer name"))   ; enter new layer name
    (setq bname (vla-get-name obj))                  ; get the blocks name
    (setq ss (ssget "x"  (list (cons 0 "INSERT") (cons 2 bname))))   ; make a collection of the block
    (repeat (setq x (sslength ss))                                   ; loop through the collection and change stuff
    (setq blk (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) ; get a block
    ; (vla-put-color blk 0)                            ; change its color 0 is Bylayer           
    (vla-put-linetype blk newlt)                     ; change linetype note BYLAYER            
    (vla-put-layer blk newlay)                       ; change its layer   
    )
    )
    (c:reset-blk)
    A man who never made mistakes never made anything

Similar Threads

  1. Ditch dialog boxes with the command-line form of commands
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 23rd Feb 2012, 09:20 am
  2. Dialog Boxes
    By Strouse3910 in forum AutoCAD General
    Replies: 17
    Last Post: 19th Dec 2011, 09:12 pm
  3. Dialog Boxes
    By RONK in forum Mechanical & MDT
    Replies: 1
    Last Post: 21st Jun 2010, 01:51 am
  4. Dialog boxes
    By maebus in forum Mechanical & MDT
    Replies: 2
    Last Post: 25th Mar 2009, 10:21 pm
  5. Dialog Boxes!!!!
    By Paul Mc in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 1st Feb 2006, 08:22 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts