See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Entmakex on AutoCAD 2025

  1. #1
    Member
    Join Date
    2016-11
    Posts
    7
    Login to Give a bone
    0

    Default Entmakex on AutoCAD 2025

    I have an AutoLisp program that uses the Entmakex function to create a non-graphical object.
    Everything was fine until a few days ago, when I installed AutoCAD 2025.1.1.
    The program stopped working and it took me a while to understand that the Entmakex function was the cause.
    I looked around the net and found something similar for Autocad LT, which has restrictions on the use of Entmakex.
    From what little I understood, Entmakex from Autocad 2025 behaves as if it were AutoCAD LT.
    Any ideas?
    I discovered the AutoCAD LT problem in this way: someone reported the bug and AutoDesk replied: it's not a bug, we did it on purpose for the LT version. (Why, I wonder)
    OK, but what about the full version?

    https://help.autodesk.com/view/ACDLT...D-DAD8F6E9AA6A

    https://help.autodesk.com/view/ACDLT...D-8F8EB64FB253

    Thank for help

    Riccardo
    Attached Images Attached Images

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,174
    Login to Give a bone
    0

    Default Re: Entmakex on AutoCAD 2025

    Do you have sample code for others to confirm the issue?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,830
    Login to Give a bone
    1

    Default Re: Entmakex on AutoCAD 2025

    Quote Originally Posted by Opie View Post
    Do you have sample code for others to confirm the issue?
    See http://www.theswamp.org/index.php?topic=59895.new#new
    R.K. McSwain | CAD Panacea |

  4. #4
    Member
    Join Date
    2016-11
    Posts
    7
    Login to Give a bone
    0

    Default Re: Entmakex on AutoCAD 2025

    Quote Originally Posted by Opie View Post
    Do you have sample code for others to confirm the issue?
    I took the source from a forum, posted way back in 2008, by "T.Willey"

    http://www.theswamp.org/index.php?topic=23762.new

    Some time ago I had modified and integrated it, for this occasion, always on the same basis as the 2008 post.

    I wrote a test program "Test-Image.Lsp", please try it.

    Code:
    ;; -------------------------------------------------------------------
    ;; Most of below source found at:
    ;; http://www.theswamp.org/index.php?topic=23762.new
    ;; -------------------------------------------------------------------
     (defun MyImage (ImPath ImInsPt LatoX
                     / ImDict ImDef Im tempEnt ReactData
                       tempData EndList StartList
                       Imname LatoY TmpList TmpMake
                       Pixellist Rpixel Xpixel Ypixel
                    )
      (setq ImName (vl-filename-base ImPath))
      (setq ImDict
        (if (setq tempData (dictsearch (namedobjdict) "ACAD_IMAGE_DICT"))
          (cdr (assoc -1 tempData))
          (dictadd
            (namedobjdict)
            "ACAD_IMAGE_DICT"
            (entmakex
              (list
                (cons 0 "DICTIONARY")
                (cons 100 "AcDbDictionary")
                (cons 280 0)
                (cons 281 1)
              ) ;; list
            ) ;; entmakex
          ) ;; dictadd
        ) ;; if
      ) ;; setq ImDict
      (setq TmpList
          (list
              (cons 0 "IMAGEDEF")
              (cons 100 "AcDbRasterImageDef")
              (cons 1 ImPath)
              (cons 280 1)
              (cons 281 (if (equal (getvar 'Measurement) 0)
                          5 ;; if equal
                          1 ;; else equal
                         ) ;; if
              ) ;; cons 281
          ) ;; list
      ) ;; setq
      ;;
      ;; AutoCAD 2025 bug?
      ;;
      (setq TmpMake (entmakex TmpList)) ;; This line
      ;;
      ;; AutoCAD 2022 gives an Entity
      ;; and program ends successfully
      ;;
      ;; AutoCAD 2025 gives nil
      ;; and program crashes on the next line with
      ;; "error: bad argument type: lentityp nil"
      ;;
      ;; AutoCAD 2025 bug?
      ;;
      (setq ImDef
       (dictadd
         ImDict
         ImName
         TmpMake
       ) ;; dictadd
      ) ;; setq
      (setq PixelList (cdr (assoc 10 (entget ImDef))))
      (setq XPixel (nth 0 PixelList))
      (setq YPixel (nth 1 PixelList))
      (setq RPixel (/ XPixel YPixel))
      (setq LatoY  (/ LatoX RPixel))
      (setq Im
       (entmake
        (list
          (cons 0 "IMAGE")
          (cons 100 "AcDbEntity")
          (cons 8  "IMAGE-RASTER") ;; Layer
          (cons 100 "AcDbRasterImage")
          (cons 10 ImInsPt)
          (list 11 (/ LatoX XPixel) 0.0 0.0) ;; Scala X
          (list 12 0.0 (/ LatoY YPixel) 0.0) ;; Scala Y
          (cons 340 ImDef)
          (cons 70 15)
          (cons 280 0)
          (cons 281 50)
          (cons 282 50)
          (cons 283 0)
          (cons 360 (entmakex
                      (list
                        (cons 0 "IMAGEDEF_REACTOR")
                        (cons 100 "AcDbRasterImageDefReactor")
                      ) ;; // list
                    ) ;; entmakex
          ) ;; cons 360
        ) ;; list
       ) ;; entmake
      ) ;; setq Im
      (setq ReactData (entget (cdr (assoc 360 (entget (setq tempEnt (entlast)))))))
      (entmod (subst
                 (cons 330 tempEnt)
                 (assoc 330 ReactData)
                 ReactData
               ) ;; subst
      ) ;; entmod
      (setq tempData (entget ImDef))
      (setq EndList (cdr (member (setq tempList (assoc 330 tempData)) tempData)))
      (setq StartList (reverse (cdr (member (car EndList) (reverse tempData)))))
      (entmod (append
                 StartList
                 (list (cons 330 (cdr (assoc 360 (entget tempEnt)))))
                 EndList
               ) ;; append
       ) ;; entmod
      (princ)
     ) ;; defun MyImage
    ;; -------------------------------------------------------------------
    ;; Most of above source found at:
    ;; http://www.theswamp.org/index.php?topic=23762.new
    ;; -------------------------------------------------------------------
    (defun c:TEST (/ My_Image My_Point My_XLato)
       (setq My_Image (getfiled "\nSelect a raster image: " "" "Jpg;Png;Tif;Gif;Bmp;Tga;Pcx" 8))
       (setq My_Point (getpoint "\nSelect an insertion point: "))
       (setq My_XLato (getreal  "\nInput length of X side: "))
       (MyImage My_Image My_Point My_XLato)
       (princ "\nDone\n")
       (princ)
    ) ;; defun C:TEXT
    ;; -------------------------------------------------------------------
    It works on AutoCAD 2022, while on AutoCAD 2025 it crashes

    Thanks for your attention

    Riccardo
    Attached Files Attached Files

Similar Threads

  1. 2025: Probleme installation Revit 2025
    By jgplans343151 in forum Revit - Platform
    Replies: 0
    Last Post: 2024-07-26, 06:17 AM
  2. Create dimension style using entmakex and modify it with entmod
    By vladimir.karatsupa982899 in forum AutoLISP
    Replies: 2
    Last Post: 2014-02-27, 02:11 PM
  3. Anybody have Entlast that works for EntmakeX?
    By tufofi in forum AutoLISP
    Replies: 3
    Last Post: 2011-09-13, 08:40 PM
  4. entmake & entmakex Usage.
    By Tharwat in forum AutoLISP
    Replies: 7
    Last Post: 2010-07-10, 07:23 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
  •