+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 39

Thread: lisp needed

  1. #21
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    Mar 2012
    Posts
    23

    Default

    Registered forum members do not see this ad.

    Dear tharwat

    its some what useful.
    but if we want to check one by one .
    can you do the lisp which can cross check standard blocks and present block so nonstandard blocks could be highlighted.

  2. #22
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,869

    Default

    Quote Originally Posted by DEEPAKRAJ View Post
    Dear tharwat

    but if we want to check one by one .
    can you do the lisp which can cross check standard blocks and present block so nonstandard blocks could be highlighted.
    Could you tell me how can I filter the selected blocks to standard and nonstandard blocks ?
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  3. #23
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    Mar 2012
    Posts
    23

    Default

    Dear tharwat,

    this is useful .

    i want a help from you can i get a lisp which can cross check the blocks from the standard file to my file and highlight the nonstandard blocks.
    which will be very useful

  4. #24
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,869

    Default

    It is not that easy to check between two files for their blocks at all and it is out of my ability .

    one solution .

    you can extract the name of all your standard blocks from the main drawing by a routine and after that you can use these names to check for current blocks in a drawing and divide them into two lists of standard and nonstandard by another routine also of course .
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  5. #25
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    Mar 2012
    Posts
    23

    Default

    your solution is good .
    can you guide me how to do it....

  6. #26
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,869

    Default

    First let us extract all names of your drawing that contains the standard blocks .
    Code:
    (defun c:BlockList (/ ss i Block blockNames)
      ;;; Tharwat 07. March . 2012 ;;;
      (if (setq ss (ssget "_x" '((0 . "INSERT"))))
        (progn
          (repeat (setq i (sslength ss))
            (if (not (member (setq Block
                                    (cdr (assoc 2 (entget (ssname ss (setq i (1- i)))))
                                    )
                             )
                             blockNames
                     )
                )
              (setq blockNames (cons Block blockNames))
            )
          )
          (print blocknames)
        )
        (princ)
      )
      (princ)
    )
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  7. #27
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Dell
    CPU:
    Intel Xeon E5-1603@2,80GHz
    RAM:
    4GB
    Graphics:
    NVIDA Quadro K600
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,507

    Default

    Quote Originally Posted by Tharwat View Post
    It is not that easy to check between two files for their blocks at all and it is out of my ability .

    one solution .

    you can extract the name of all your standard blocks from the main drawing by a routine and after that you can use these names to check for current blocks in a drawing and divide them into two lists of standard and nonstandard by another routine also of course .
    although that can only check that the names match. It is far harder (or at least outside my ability) to check that the block definitions are identical in both places which I thought was the task requested.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
    "Everything in drafting is logical. Except what isn’t." - Gavin Guile. (from the Lightbringer series of books by Brent Weeks)

    Dave

  8. #28
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    Mar 2012
    Posts
    23

    Default

    i did this then what should i do

  9. #29
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,869

    Default

    Quote Originally Posted by DEEPAKRAJ View Post
    i did this then what should i do
    did you see all your standards block names prompted in the command line ?

    Try this one which is better than the above one to check all blocks definitions and not only the inserted ones .

    Code:
    (defun c:BlockList (/ ss Block blockNames)
    ;;; Tharwat 07. March . 2012 ;;;
      (while (setq ss (tblnext "BLOCK" (null ss)))
        (if (not (member (setq Block
                                (cdr (assoc 2 ss))
                         )
                         blockNames
                 )
            )
          (setq blockNames (cons Block blockNames))
        )
      )
      (if blocknames
        (print blocknames)
      )
      (princ)
    )
    And after that save the name of blocks that would be listed in the command line to include them later on in the second routine .

    But be patient , I have many things to do at the office and would write one for you as soon as I have time to do .

    Tharwat
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  10. #30
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,869

    Default

    Registered forum members do not see this ad.

    Consider this code as a draft at this moment

    Code:
    (defun c:Test (/
                   BlockList
                   stand
                   non
                   ss
                   Blockname
                   StandardBlockname
                   nonstandardBlockname
                  )
      ;;; Tharwat 07. March. 2012 ;;;
      (setq BlockList '("Block1" "Block2"));;; Put the block name that you got from the first routine instead of the block names
      (if (and (setq ss (ssget "_x" '((0 . "INSERT"))))
               (setq stand 0)
               (setq non 0)
          )
        (repeat (setq i (sslength ss))
          (setq
            Blockname (cdr (assoc 2 (entget (ssname ss (setq i (1- i))))))
          )
          (cond ((member Blockname BlockList)
                 (progn
                   (setq stand (1+ stand))
                   (setq standardBlock (cons Blockname standardBlock))
                 )
                )
                (t
                 (progn
                   (setq non (1+ non))
                   (setq nonstandardBlock (cons Blockname nonstandardBlock))
                 )
                )
          )
        )
        (princ)
      )
      (if Blockname
        (alert (progn
                 (strcat " You have : < "
                         (itoa stand)
                         " > Standard Blocks inserted into this drawing "
                 "\n"
                 (strcat " You have : < "
                         (itoa non)
                         " > Nonstandard Blocks inserted into this drawing "
                 )
               )
        )
               )
        )
      (princ)
    )
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

Similar Threads

  1. Help needed with a Lisp .
    By Tharwat in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 4th Sep 2010, 10:46 pm
  2. Lisp Dimension help needed...
    By streivor in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 1st Jun 2010, 06:44 pm
  3. LISP Needed
    By good_m in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 21st May 2009, 01:40 pm
  4. lisp needed
    By CadTechJGC184 in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 18th May 2009, 09:23 pm
  5. S.O.S. - LISP &/or VBA Assistance Needed
    By Broman in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 24th Nov 2006, 09:35 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