Insert Block Problem

Started by dsm_dude, June 12, 2024, 06:35:32 AM

Previous topic - Next topic

dsm_dude

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)
)

dsm_dude

Can someone help with a solution?