OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Kerry on July 31, 2008, 04:34:10 PM

Title: dcl_Project_Dump ; dcl_Form_GetControls
Post by: Kerry on July 31, 2008, 04:34:10 PM
Does anyone have a sample using dcl_Project_Dump  :
or extracting the data from the return value from dcl_Form_GetControls

I tried this with no sucess

    (Setq rValue (dcl_Form_GetControls KDUB_PIPEFLANGES_Main))
    (foreach var rValue
      (print var)
      (foreach n (entget var) (print n))
   )


I'm trying to get a list of ALL controls in a project.
The Project includes a TabControl with several pages


Would it be difficult to have an Editor Method that could write a tree listing to file of Names of Forms ; Children ; Controls

Regards
Kerry
Title: Re: dcl_Project_Dump ; dcl_Form_GetControls
Post by: Kerry on July 31, 2008, 07:51:48 PM
This seems to work ..

(kdub:GetControlNames "C:\\KDUB_PIPEFLANGES.odcl" )


(defun kdub:GetControlNames (odclfile / project  CONTROLNAME FN)
  (setq project (dcl_project_load odclfile))
  (if (not project)
    (exit)
  )
  (setq fn (open (strcat "c:\\" project "-Controls.txt") "w"))
  (foreach form (dcl_project_getforms project)
    (foreach control (dcl_form_getcontrols form)
      (progn (setq props (dcl_control_getproperties control))
             (if (member "(Name)" props)
               (progn (setq ControlName (dcl_control_getproperty control "(Name)"))
                      (write-line ControlName fn)
               )
             )
      )
    )
  )
  (close fn)
 
)

Quote
Frame-M2
Frame-M0
Label1
TabControl1
MATERIALCombo
SIZELIST
SIZETEXT
SIZEOPTION
Frame6
Frame5
Frame4
Frame3
Frame2
Frame1
FLANGEMATCH
FLANGEINFO
FLANGEPICCY
FLANGEDRAW
FLANGEWORKPOINT
FLANGEVIEW
FLANGEFACE
FLANGETABLECLASS
FLANGESPECIFICATION
FLANGETYPE
Frame1
Frame1
PairGapTextBox
GapLabel
FaceOffsetTextBox
WeldGapTextBox
FaceOffsetCheck
DrawPairCheck
WeldGapCheck
ComboOutlineLayer
ComboOutlineColor
ComboHoleBlockColor
< SNIP>