See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Old code not working in AutoCAD 2022

  1. #1
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Old code not working in AutoCAD 2022

    Hi All
    I have a great deal of code that I use to speed up my drawing process that I have used for years without a problem until 2022. The latest software update resolved a few of problems I was experiencing but not all of them. I am not quite sure what about the following code keeps hanging up. It works fine in all versions up 2021. You can substitute "wdstud" with any block you wish to test the routine with. Thank you for any help you can provide.
    Manuel A. Ayala

    Code:
    (if (setq pt1 (getpoint "\nInsert point: "))   
      (progn
        (command "_.insert" "wdstud" pt1 "" "" "")
        (setq ent1 (entlast))
        (princ "\nRotate: ")
        (command "_.rotate" ent1 "" pt1 pause)
        (command "_.copy" ent1 "" "m" pt1)
        (setq pt2 pt1)
        (while (and pt2 (/= pt2 "done"))
          (setq pt2 (getpoint pt1 "\nSecond point of displacement <done>: "))
          (cond 
            ((null pt2)(setq pt2 "done")(command))
             ((LISTP pt2) (command pt2))
           )
         )
      )
    )

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

    Default Re: Old code not working in AutoCAD 2022

    What command is it hanging on? Insert, rotate, or copy?
    You should also add code to test to see if the block is defined in the drawing
    Code:
    (tblsearch "block" "wdstud")
    before trying to insert it.

  3. #3
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    1

    Default Re: Old code not working in AutoCAD 2022

    You should try and see which line of code it is throwing an error.

  4. #4
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Old code not working in AutoCAD 2022

    Hi Tom
    In my full routine, I do check to see if the block exists with a tblsearch. Thanks.
    Manuel

    - - - Updated - - -

    It seems to hang up on the copy command. Having said that, if I run the code line by line at the command prompt it works. It works in every previous version AutoCAD except 2022. I am puzzled as to what is the problem.
    Manuel

  5. #5
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Old code not working in AutoCAD 2022

    After much testing I think the problem is a bug in the copy command. Apparently, AutoCAD doesn't regren between picks so you don't see the objects you have placed. It also doesn't show your crosshairs moving so you are led to believe that it is not working. When you cancel the command it forces a regen which then displays the blocks you have placed. I have a similar problem happen with a revision cloud routine where the application doesn't regen between picks so you don't see the cloud until you cancel the routine. It appears that the latter problem has been reported to AutoDesk but I am not sure aboutt the copy command issue. Unless someone knows how to issue a regen between point selections, I will have to wait until the problem is addressed, hopefully, in the next software update. Thanks.
    Manuel

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

    Default Re: Old code not working in AutoCAD 2022

    Quote Originally Posted by cadconcepts View Post
    Hi Tom
    In my full routine, I do check to see if the block exists with a tblsearch. Thanks.
    Manuel

    - - - Updated - - -

    It seems to hang up on the copy command. Having said that, if I run the code line by line at the command prompt it works. It works in every previous version AutoCAD except 2022. I am puzzled as to what is the problem.
    Manuel
    Posting the full routine would make it easier to fix.
    Try using entupd (AutoLISP) https://help.autodesk.com/view/ACD/2...A-288DD347A783
    Updates the screen image of an object (entity)
    At a glance adding
    Code:
    (entupd (entlast))
    after
    Code:
    (command pt2)
    should do the trick.

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

    Default Re: Old code not working in AutoCAD 2022

    Looking again at what you're doing why not just use the MOCORO (Express Tool) https://help.autodesk.com/view/ACD/2...B-71C7D19409F5
    Moves, copies, rotates, and scales selected objects with a single command.
    Built in command that does the same thing but looks slicker with help available by hitting F1 like any other AutoCAD command.

Similar Threads

  1. 2022 - Dynamic Block with Constrains
    By mhannan.100562 in forum Dynamic Blocks - Technical
    Replies: 0
    Last Post: 2021-08-24, 03:03 PM
  2. 2021: 2022: Updated Fabrication COD Script Library (Free download)
    By Darren J. Young in forum FABmep General
    Replies: 0
    Last Post: 2021-06-24, 06:51 AM
  3. 2021: 2022 issues
    By rmk in forum AutoCAD Civil 3D - General
    Replies: 2
    Last Post: 2021-06-23, 12:40 PM
  4. What’s new in Revit 2022
    By amit.sondagar795716 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2021-05-18, 01:35 PM
  5. 2021: Fix for missing Fabrication Add-ins for Revit 2022
    By Darren J. Young in forum Revit MEP - General
    Replies: 1
    Last Post: 2021-05-04, 12:56 PM

Posting Permissions

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