Recent posts

#81
Runtime/AutoLISP / Re: MOVE (drag&drop) an item f...
Last post by owenwengerd - March 13, 2024, 09:18:16 PM
I believe the Drag N Drop sample shows drag/drop in a single tree control, and also between tree and list controls.
#82
Runtime/AutoLISP / Re: MOVE (drag&drop) an item f...
Last post by domenicomaria - March 12, 2024, 11:30:23 PM
and I need also to move an item in the same tree control from a position to another (always with drag&drop)

I am trying to use
dragoverfromcontrol and dcl-Tree-AddSibling
without success

I would need an example

#83
Runtime/AutoLISP / MOVE (drag&drop) an item from ...
Last post by domenicomaria - March 12, 2024, 09:15:26 PM
If I drag an item from the tree-00  control to the tree-01 control,
the source item is removed from the source tree
but nothing happens in the target tree ...
...

what is the trick to MOVE an item from a tree to another one ?

i am not able to know what is the item of the target tree where the source item is dropped ...

what have I to do ?
#84
Runtime/AutoLISP / Re: OpenDCL AutoCad LT 2024
Last post by Christina - March 04, 2024, 10:10:05 PM
Thank you for the explanation Joseph !
#85
Runtime/AutoLISP / DragnDrop / HitPointTest
Last post by DW - March 03, 2024, 10:26:58 PM
After discovering problems with HitPointTest and high-resolution monitors, I came across this post which was helpful to bring to attention the registry key AppliedDPI - thanks honkinberry. Tried to add a reply to the post but seems a database error is preventing it...

If anyone else is searching for a solution to the issue of HitPointTest giving incorrect results at varying screen resolutions, I found the following approach to work.

Where screen resolution varies from 96dpi (which seems to be the default for correct operation),  I use the scale factor between 96dpi and the higher resolution to recalculate the value returned by DropPoint.  HitPointTest then processes the adjusted value.

In my case, I'm using a ListView control and need both coordinates...

(defun c:xlsfmt_to_OnDragnDropFromControl
       (ProjectName FormName ControlName DropPoint / rc dpi)
  ;; get screen resolution
  (setq dpi
(vl-registry-read
  "HKEY_CURRENT_USER\\Control Panel\\Desktop\\WindowMetrics"
  "AppliedDPI"
)
  )
  (if (< 96 dpi)
    ;; the difference in resolution of a 1080p monitor and anything else is calculated
    ;; say 1080p @ 100% = 96 dpi, 3840 x 2160 @ 150% = 144 dpi
    ;; 96 / 144 = 0.66667 which is the scaling factor applied to DropPoint
    (setq DropPoint
   (mapcar '(lambda (x) (roundval (* (/ (float 96) (float dpi)) x) 1))
   DropPoint
   )
    )
    ;; otherwise do nothing
  )
  ;; HitPointTest then reports the correct relative coordinates
  (setq rc (dcl_ListView_HitPointTest xlsfmt_to (car DropPoint) (cadr DropPoint)))
    ; do something with rc ...
)   ; end defun

(defun RoundVal (value to)
  (setq to (abs to))
  (* to
     (fix (/ ((if (minusp value)
-
+
      )
       value
       (* to 0.5)
     )
     to
  )
     )
  )
)
#86
Deployment / Re: Problems with OpenDCL Runt...
Last post by mlmichel - February 20, 2024, 11:00:41 AM
Owen,

Thank you for your quick responses. I greatly appreciate them!

I am having new issues finally!

I am trying to load my OpenDCL file named "01_Dialog.odcl" with a modal dialog named "Description"

My lisp is saved in C:\Users\mmichel\Desktop\lisps that work\

My .odcl file is saved in C:\Users\mmichel\Desktop\lisps that work\

I have the current support file search paths set:
     C:\Users\mmichel\Desktop\Lisps that work\
     C:\Program Files (x86)\Common Files\OpenDCL
     C:\Program Files (x86)\OpenDCL Studio

I browsed through a couple forms and watched the "01_hello_world" videos and I have this problem:

autocad command:


DIA4
_OPENDCL
Command: ; error: ADS request error


    AutoCAD Message

    Project failed to load!
    The file could not be found or an error occurred while reading the file.

    [01_Dialog.odcl]

AND

    OpenDCL Runtime Error

    An OpenDCL function argument processing exception has occurred!

    Error: NIL value not allowed
    Function: dcl_Form_Show
    Argument: 0


Here is my lisp code:

(defun c:dia1 ()
  (load "C:\\Users\\mmichel\\Desktop\\lisps that work\\0.1.lsp")
)
;======================================================================
(defun c:dia2 ()
  (command "_OPENDCL")
  (setq form (dcl-project-load "01_Dialog.odcl")) ; -> "Form1"
  (setq returnResult (odcl_form_IsActive Form1/Dialog_Option)) ; -> 1
  (princ) 
)
;======================================================================
(defun C:dia3()
  (EnsureProjectLoaded "01_Dialog.odcl") ;if this returns, all is well
  (if (not (opdcl_Form_IsActive Description))
    (odcl_Form_Show Description)
  )
)
;======================================================================
(defun c:dia4 ()
  (command "_OPENDCL")
  (dcl_project_load "01_Dialaog.odcl" T)
  (dcl_form_show 01_Dialog_Description)
  (princ)
)

If you don't mind, if you edit the code, can you paste the entire code? Otherwise my noobiness might be on full display.

note:

dia2 and dia3 are what other forums recommended, these do not work either.

I am trying to be as descriptive as I can just in case others have similar issues in the future, but if you need any more information, let me know!
#87
Deployment / Re: Problems with OpenDCL Runt...
Last post by owenwengerd - February 19, 2024, 04:03:13 PM
Make sure you're installing OpenDCL 9.2.1.5 (the current development version, not the stable version). That installer should create demand load registry keys as long as Acad 2024 is installed. You should not change any settings or search paths.
#88
Deployment / Re: Problems with OpenDCL Runt...
Last post by mlmichel - February 19, 2024, 02:35:29 PM
I have also tried dragging and dropping the .arx files into Civil 3D, it is displays:

Command: (ARXLOAD "C:/Program Files (x86)/Common Files/OpenDCL/OpenDCL.16.arx") ; error: ARXLOAD failed

Product Version: 13.6.1781.0 Civil 3D 2024.3 Update
Built on: U.152.0.0 AutoCAD 2024.1.2
27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
8.6.52.0 AutoCAD Architecture 2024
#89
Deployment / Re: Problems with OpenDCL Runt...
Last post by mlmichel - February 19, 2024, 02:24:44 PM
Hello, thank you for your response. I just got around to tinkering with this.

I've done as you instructed, I see the files in my Common files directory. I have DEMANDLOAD set to 3.

1)I have my Support File Search Paths set to the both OpenDCL folders.

2)I am NOT seeing any OpenDCL files in my registry as mentioned in this forum:
     https://opendcl.com/forum/index.php?topic=279.msg2211#msg2211

  I can do a ctrl+f on the registry and search "opendcl" and it finds only one file:
     (default)     REG_SZ     OpenDCL.Project

I am using Civil 3D 2024 and by extension AutoCAD 2024.

I've read through a variety of forums and cannot fix this, it always seems that they solve the problem before my problem is solved.

Thank you for you help!

 - Maxwell
#90
Deployment / Re: Problems with OpenDCL Runt...
Last post by owenwengerd - February 17, 2024, 08:52:45 AM
The runtime modules are installed in %ProgramFiles(x86)%\Common Files\OpenDCL, and the OPENDCL command is registered by the installer for demand loading in all supported CAD applications that are detected. You didn't mention which CAD application and version you're using, but it must enable demand loading (DEMANDLOAD=3).