2018-08-21 03:49 UTC
Hi,
I want to add Block names into the ComboBox
I coded like this...
But sometimes the ComboBox does not fill anythings...
and Cad shows like this error messages :
; error: Unknown exception occurred
; warning: unwind skipped on unknown exception
what should I do at this time?
Thanks, Khann.
***
(setq *All_Block_Names (F:Sub_Get_All_Block_Names))
(dcl-ComboBox-Clear TransfoA1/Form/cboRBListNew)
(dcl-ComboBox-AddList TransfoA1/Form/cboRBListNew *All_Block_Names)
***
(defun F:Sub_Get_All_Block_Names ( / *ALL_BLOCKS *ALL_BLOCK_NAMES *CURDOC *TMP_BNAME)
(setq *All_Block_Names '())
(setq *Curdoc (vla-get-activedocument (vlax-get-acad-object)))
(setq *All_Blocks (vla-get-blocks *Curdoc))
(vlax-for *Block_Item *All_Blocks
(setq *Tmp_BName (vla-get-name *Block_Item))
(if (wcmatch (substr *Tmp_BName 1 4) "00*-")
(progn
(setq *All_Block_Names (cons *Tmp_BName *All_Block_Names))
)
)
)
(setq *All_Block_Names (reverse *All_Block_Names))
(setq *All_Block_Names (vl-sort *All_Block_Names '<))
*All_Block_Names
)
I want to add Block names into the ComboBox
I coded like this...
But sometimes the ComboBox does not fill anythings...
and Cad shows like this error messages :
; error: Unknown exception occurred
; warning: unwind skipped on unknown exception
what should I do at this time?
Thanks, Khann.
***
(setq *All_Block_Names (F:Sub_Get_All_Block_Names))
(dcl-ComboBox-Clear TransfoA1/Form/cboRBListNew)
(dcl-ComboBox-AddList TransfoA1/Form/cboRBListNew *All_Block_Names)
***
(defun F:Sub_Get_All_Block_Names ( / *ALL_BLOCKS *ALL_BLOCK_NAMES *CURDOC *TMP_BNAME)
(setq *All_Block_Names '())
(setq *Curdoc (vla-get-activedocument (vlax-get-acad-object)))
(setq *All_Blocks (vla-get-blocks *Curdoc))
(vlax-for *Block_Item *All_Blocks
(setq *Tmp_BName (vla-get-name *Block_Item))
(if (wcmatch (substr *Tmp_BName 1 4) "00*-")
(progn
(setq *All_Block_Names (cons *Tmp_BName *All_Block_Names))
)
)
)
(setq *All_Block_Names (reverse *All_Block_Names))
(setq *All_Block_Names (vl-sort *All_Block_Names '<))
*All_Block_Names
)