Jump to content

How to disable attribute "LOCK POSITION" while creating Lisp


Recommended Posts

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • pBe

    9

  • bijoyvm

    7

  • Tharwat

    6

  • Lee Mac

    5

Top Posters In This Topic

I always wondered about that myself bijoyvm. what i usually do is include this code after creation of the block

 

Even with Vanilla AutoLISP, the modification to the Block Insertion Units must be processed after creation of the Block Definition, since the BLOCK_RECORD entity doesn't exist until the BLOCK entity is created.

 

An example to set the Insertion Units to Inches:

 

(defun c:crb ( )
   (if (not (tblsearch "BLOCK" "CRBLK"))
       (progn
           (if (not (tblsearch "STYLE" "Gen-Text"))
               (entmake
                   (list
                       (cons 0 "STYLE")
                       (cons 100 "AcDbSymbolTableRecord")
                       (cons 100 "AcDbTextStyleTableRecord")
                       (cons 2 "Gen-Text")
                       (cons 70 0)
                       (cons 40 2.5)
                       (cons 3 "Arial.ttf")
                   )
               )
           )
           (entmake
               (list
                   (cons 0 "BLOCK")
                   (cons 8 "0")
                   (cons 370 0)
                   (cons 2 "CRBLK")
                   (cons 70 2)
                   (list 10 0.0 0.0 0.0)
               )
           )
           (entmake
               (list
                   (cons 0 "CIRCLE")
                   (cons 8 "0")
                   (cons 370 0)
                   (list 10 0.0 0.0 0.0)
                   (cons 40 1.25)
               )
           )
           (entmake
               (list
                   (cons 0 "ATTDEF")
                   (cons 8 "0")
                   (cons 370 0)
                   (cons 7 "Gen-Text")
                   (list 10 3.0 0.0 0.0)
                   (list 11 3.0 0.0 0.0)
                   (cons 40 2.5)
                   (cons 1 "00")
                   (cons 3 "Number")
                   (cons 2 "NO")
                   (cons 70 0)
                   (cons 72 0)
                   (cons 74 2)
               )
           )
           (entmake
               (list
                   (cons 0 "ENDBLK")
                   (cons 8 "0")
               )
           )
           (
               (lambda ( lst )
                   (regapp "ACAD")
                   (entmod
                       (append (subst (cons 70 1) (assoc 70 lst) lst)
                           (list
                              (list -3
                                  (list "ACAD"
                                      (cons 1000 "DesignCenter Data")
                                      (cons 1002 "{")
                                      (cons 1070 1)
                                      (cons 1070 1)
                                      (cons 1002 "}")
                                  )
                              )
                          )
                       )
                   )
               )
               (entget (cdr (assoc 330 (entget (tblobjname "BLOCK" "CRBLK")))))
           )
       )
   )
   (princ)
)

Link to post
Share on other sites
Even with Vanilla AutoLISP, the modification to the Block Insertion Units must be processed after creation of the Block Definition, since the BLOCK_RECORD entity doesn't exist until the BLOCK entity is created.

 

Super :thumbsup:

Thanks Lee

 

BTW: How'd you come up with this:

(regapp "ACAD")
                   (entmod
                       (append (subst (cons 70 1) (assoc 70 lst) lst)
                           (list
                              (list -3
                                  (list "ACAD"
                                      (cons 1000 "DesignCenter Data")
                                      (cons 1002 "{")
                                      (cons 1070 1)
                                      (cons 1070 1)
                                      (cons 1002 "}")
                                  )
                              )
                          )
                       )
                   )

 

Reverse engineering? :)

Link to post
Share on other sites

i tired to fix the problem,highlight 1 is working but when i open any cad file highlight will change automatically to "0", and another problem fill 1 is working but when open any cad new fill it go fill "0", when i will try to move the line it go wrong direction, i really upset and last 2 weaks i can't work my project, please kindly i request please send any solution to this problem.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...