See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How to access Filter command through command line

  1. #1
    100 Club
    Join Date
    2007-10
    Location
    God's Own Country
    Posts
    183
    Login to Give a bone
    0

    Question How to access Filter command through command line

    Hi,
    I want to create a script to select some particular object from a drawing.
    anyone help me to select object through command line (without dialogue box)?

    Thanks,
    Sandeep kumar

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    The filter command has always used a dialog box. I've got the old lsp and dcl files, if you'd like me to send them offline. You could probably modify it to work without the dialog box. Have you tried ssx.lsp and getsel.lsp which come with AutoCAD? Lots of ways to select objects with lisp. What specifically are you trying to do?

  3. #3
    100 Club
    Join Date
    2007-10
    Location
    God's Own Country
    Posts
    183
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    Thanks for your reply,
    Yesterday we got some (300) structural details, change the colour of two leyers named border & notes to cyan (colour index4) at each drawing. and some drawing have two dimension layers, one with correct spelling (dmensions) and the other with misspelled (dimesions) I want to select all dimension object to the proper dimensions layer. and delete the other one.
    I create a script to do that and run with scriptpro , but where the detail have one layer of dimensions, the script will stuck there. bcz there is no dimesions layer to rename.
    Any idea???


    Quote Originally Posted by Tom Beauford View Post
    The filter command has always used a dialog box. I've got the old lsp and dcl files, if you'd like me to send them offline. You could probably modify it to work without the dialog box. Have you tried ssx.lsp and getsel.lsp which come with AutoCAD? Lots of ways to select objects with lisp. What specifically are you trying to do?

  4. #4
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    To make sure that there's no problem with layers not existing in a drawing, you could use some LISP inside the SCR:
    Code:
    (if (tblsearch "LAYER" "dimesions")
      (if (tblsearch "LAYER" "dimensions")
        (command "._LAYMRG" "dimesions" "" "dimensions" "_Yes")
        (command ".-RENAME" "_LAyer" "dimesions" "dimensions")
      )
    )
    Basically it checks if the wrongly spelt dimesions layer exists (if not it doesn't do anything). But if it does, it check if the correctly spelt layer dimensions exists. If that does, then it uses Layer Merge to "move" all entities from the wrong layer to the correct one & purge the wrong layer out. If the correct layer doesn't exist, then it simply renames the wrong one.

    You can do similar stuff for other things as well. E.g. to change the colour of a layer only if it exists:
    Code:
    (if (tblsearch "LAYER" "border")
      (command ".-LAYER" "_Color" 4 "border" "")
    )

  5. #5
    100 Club
    Join Date
    2007-10
    Location
    God's Own Country
    Posts
    183
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    Thank you for reply,
    I've been trying to add the routine to the script, but error showing while running the script.
    So im attaching the dwg file and the script here. please look.
    Thanks in advance.
    Sandeep kuamar

    Quote Originally Posted by irneb View Post
    To make sure that there's no problem with layers not existing in a drawing, you could use some LISP inside the SCR:
    Code:
    (if (tblsearch "LAYER" "dimesions")
      (if (tblsearch "LAYER" "dimensions")
        (command "._LAYMRG" "dimesions" "" "dimensions" "_Yes")
        (command ".-RENAME" "_LAyer" "dimesions" "dimensions")
      )
    )
    Basically it checks if the wrongly spelt dimesions layer exists (if not it doesn't do anything). But if it does, it check if the correctly spelt layer dimensions exists. If that does, then it uses Layer Merge to "move" all entities from the wrong layer to the correct one & purge the wrong layer out. If the correct layer doesn't exist, then it simply renames the wrong one.

    You can do similar stuff for other things as well. E.g. to change the colour of a layer only if it exists:
    Code:
    (if (tblsearch "LAYER" "border")
      (command ".-LAYER" "_Color" 4 "border" "")
    )
    Attached Files Attached Files

  6. #6
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    Attached modified script and DWG.

    I did have an error with the LAYMRG command. Fixed it in attached SCR.
    Attached Files Attached Files

  7. #7
    100 Club
    Join Date
    2007-10
    Location
    God's Own Country
    Posts
    183
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    I am with ACad 2004, when I drag the script to graphic area, the attached error showing.
    wht cd be wrong??

    Sandeep kumar

    Quote Originally Posted by irneb View Post
    Attached modified script and DWG.

    I did have an error with the LAYMRG command. Fixed it in attached SCR.
    Attached Images Attached Images

  8. #8
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    Oooohhhh! Sorry LAYMRG used to be an Express Tool prior to 2007. Do you have Express installed? If so check for the command when you use Express --> Layers --> Merge Layers. Then also check what prompts is asked, maybe they differ from the new built-in command.

  9. #9
    100 Club
    Join Date
    2007-10
    Location
    God's Own Country
    Posts
    183
    Login to Give a bone
    0

    Default Re: How to access Filter command through command line

    Sorry for delay,
    Yes, Acad Access the laymrg command and I installed express tools also.
    attached txt window as png file.
    thanks
    Sandeep kumar

    Quote Originally Posted by irneb View Post
    Oooohhhh! Sorry LAYMRG used to be an Express Tool prior to 2007. Do you have Express installed? If so check for the command when you use Express --> Layers --> Merge Layers. Then also check what prompts is asked, maybe they differ from the new built-in command.
    Attached Images Attached Images
    Last edited by sandeepk; 2009-05-08 at 06:28 AM.

  10. #10
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    1

    Default Re: How to access Filter command through command line

    Try doing the LAYMRG command in Model Space (i.e. TILEMODE=1). Maybe there was a change in this command since 2004. Unfortunately I'm on subscription, so I can't install my old version to check

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 2009-10-22, 10:19 PM
  2. Replies: 6
    Last Post: 2007-04-23, 01:40 AM
  3. Replies: 1
    Last Post: 2006-11-16, 03:09 PM
  4. Replies: 4
    Last Post: 2006-05-09, 08:57 PM
  5. setting for command line word wrap (esp. DIST command)
    By lcamara in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2005-02-23, 08:47 AM

Posting Permissions

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