Recent posts

#31
Runtime/AutoLISP / Insert Block Problem
Last post by dsm_dude - June 12, 2024, 06:35:32 AM
I reworked an odcl project for autocad that was created by tinomartinez 14 years ago for BricsCAD.

I am stumped when it comes to inserting a block using OpenDCL. I've combed over these forms and the swamp trying to find a solution but I've come up emtpy.

Can someone please take a look and help me out?

(defun c:ttt (/)
  (command "OPENDCL")
  (dcl_Project_Load "BlockManager" T)
  (dcl_Form_Show BlockManager_Form1)
  (princ)
  )

(defun c:Untitled/Form1#OnInitialize (/)
  (setq strPath (list
  (list "Metric" "W:\\Engineering\\AutoCAD Support\\Blocks\\Borders\\Metric")
  (list "Imperial" "W:\\Engineering\\AutoCAD Support\\Blocks\\Borders\\Imperial"))
);setq
  (dcl-Control-SetList BlockManager/Form1/Shortcut (mapcar '(lambda (x) (car x)) strPath))
  (dcl-BlockView-LoadDwg BlockManager/Form1/BlockView "") ;; new line to clear viewblock
  ;(dcl-BlockView-Clear BlockManager/Form1/BlockView)
)

(defun c:BlockManager/Form1/Shortcut#OnSelChanged (ItemIndexOrCount Value /)
  (dcl-ListBox-Dir BlockManager/Form1/DWGList (setq oBlockPreviewFolder (cadr(nth (dcl-ListBox-GetCurSel BlockManager/Form1/shortcut) strPath))) "*.dwg")
)

(defun c:BlockManager/Form1/DWGList#OnSelChanged (ItemIndexOrCount Value /)
  (dcl-BlockView-LoadDwg BlockManager/Form1/BlockView (setq oBlockPreviewFile(strcat oBlockPreviewFolder "\\" Value)));_ load the DWG
  (dcl-BlockView-Zoom BlockManager/Form1/BlockView 0.75)
)

(defun c:BlockManager/Form1/Insert#OnClicked (/)
  (dcl_Form_Hide BlockManager_Form1)
  (command "._insert" oBlockPreviewFile '(0 0 0) 1 1 0)
)
#32
Show and Tell / Re: My first OpenDCL
Last post by dsm_dude - June 10, 2024, 06:20:04 AM
I've reviving this old thread. I really like the layout of this block manager, but it's no longer working and throwing an error when the insert command is invoked. I've invested several hours trying to resolve the issue with no luck. Can someone more skilled than myself take a crack at it?
#33
Runtime/AutoLISP / Re: to know from Lisp the TYPE...
Last post by domenicomaria - June 05, 2024, 12:19:52 AM
I solved it by reading logfilename
...
but it's not elegant
...
it would serve a function
(dcl-control-gettype ename-or-control-name)

#34
Runtime/AutoLISP / Re: to know from Lisp the TYPE...
Last post by domenicomaria - June 02, 2024, 11:00:34 PM
dcl-control-dump returns:
CDclControlobject [CtlComboBox: ...
CDclControlobject [CtlCheckBox: ...
CDclControlobject [CtlGraphicButton: ...
and so on ...

but it print the results in the command line

and dcl-control-dump simply returns T
. . .
How can I access this information?
How do you know the TYPE of control?
#35
Runtime/AutoLISP / to know from Lisp the TYPE of ...
Last post by domenicomaria - June 02, 2024, 06:43:42 AM
Is there a way to know from Lisp the TYPE of a control contained in an ODCL form?

with dcl-Form-GetControls I get the "entity names" of all the controls

and now I can access many properties of each control

but I can't understand which property allows me to understand if the control is a ListBox, a ComboBox, a TextBox... and so on
#36
Runtime/AutoLISP / Re: OpenDCL MEMORY MANAGEMENT ...
Last post by domenicomaria - May 31, 2024, 07:20:52 AM
GRAPHIC BUTTON  (tt-graphic-button)
number of repetitions : 5000
average list MIN : 165
average list MAX : 169
AVERAGE of AVERAGES : 167.320
AVERAGE LIST : (165 165 165 166 165 166 167 169 167 165 165 167 166 167 167 167 166 165 167 165 167 168 167 169 166 167 168 169 167 167 169 168 167 169 169 168 169 168 168 169 169 168 168 168 168 168 169 169 169 169)


TEXT BUTTON  (tt-text-button)
number of repetitions : 5000
average list MIN : 144
average list MAX : 151
AVERAGE of AVERAGES : 146.380
AVERAGE LIST : (144 144 146 145 145 145 146 145 145 144 145 145 145 145 145 145 145 146 146 144 144 146 147 147 147 147 145 145 147 147 146 147 146 146 147 149 147 149 149 148 147 148 147 148 148 149 148 149 151 148)


it seems like TEXT-BUTTON and GRAPHIC-BUTTON don't have any problem...

Quoteinteresting... after updating with the latest runtime I'm noticing dialogs with many controls including combos are snappier to open!

that's how it is... the problem is not completely solved, but things are certainly better!
#37
Runtime/AutoLISP / Re: OpenDCL MEMORY MANAGEMENT ...
Last post by DW - May 29, 2024, 09:27:16 PM
Quote from: owenwengerd on May 25, 2024, 01:15:53 PMThanks, I found and fixed a bigger leak in several combo types. I'll include the fix in the next release.
Interesting... after updating with the latest runtime I'm noticing dialogs with many controls including combos are snappier to open!
#38
Runtime/AutoLISP / Re: OpenDCL MEMORY MANAGEMENT ...
Last post by domenicomaria - May 27, 2024, 10:29:52 PM
Quote from: owenwengerd on May 27, 2024, 11:43:15 AMI checked tt-text-box.odcl, but I did not notice any leaks. I think the effect in that case is just due to normal and unavoidable memory fragmentation, not actual leaks.
And what about TAB STRIP ?
is it the same thing ?
However I will continue to test other controls, and will report the results ...
#39
Runtime/AutoLISP / Re: OpenDCL MEMORY MANAGEMENT ...
Last post by owenwengerd - May 27, 2024, 11:43:15 AM
I checked tt-text-box.odcl, but I did not notice any leaks. I think the effect in that case is just due to normal and unavoidable memory fragmentation, not actual leaks.
#40
Studio/Dialog Editor / Re: Splitter Control goes wron...
Last post by owenwengerd - May 26, 2024, 10:04:03 AM
I think I found the reason for the About issue. If I am correct, it should be fixed int he next release.