Beta 4 - dcl_Form_GetControls and dcl_Project_GetForms

Started by velasquez, December 08, 2008, 04:27:07 AM

Previous topic - Next topic

velasquez

(dcl_Form_GetControls HTML_Dcl1) 
Return (<Entity name: 127b1ca0> <Entity name: 127b1f40> <Entity name: 127b1c30> <Entity name: 127b1ed0> <Entity name: 127b1e60> <Entity name: 165b7f0> <Entity name: 122769f0> <Entity name: 1282a060> <Entity name: 1282a0d0> <Entity name: 1282a140> <Entity name: 1282a1b0> <Entity name: 1282a220> <Entity name: 1282a290> <Entity name: 1282a300> <Entity name: 1282a370> <Entity name: 1282a3e0> <Entity name: 1282a450> <Entity name: 1282a4c0> <Entity name: 1282a530>) 
 
(DCL_PROJECT_GETFORMS " HTML ") 
Return (<Entity name: 12800428>) 
 
It is not possible to treat this list with -> (entget ename [applist]) 
That is a BUG? 

owenwengerd

That is not a bug. Forms and controls are not AutoCAD entities, despite their representation in AutoLISP as entity names.
Owen Wengerd (Outside The Box) / ManuSoft

velasquez

Ok Owen, 
How to work with this list? 
Should not she show the names of Forms and of the controls?

BazzaCAD

Here's an example written by Owen, that shows how to read all the controls on a form, change their properties & write them back to a new ODCL file.



(DEFUN SetOdclFontSizeUnscaled (odclfile password newodclpath / project props fontsize)
  (SETQ project (DCL_PROJECT_LOAD odclfile))
  (IF (NOT project) (EXIT))
  (FOREACH form (DCL_PROJECT_GETFORMS project)
    (FOREACH control (DCL_FORM_GETCONTROLS form)
      (PROGN (SETQ props (dcl_control_getproperties control))
        (IF (MEMBER "FontSize" props)
          (PROGN
            (SETQ fontsize (DCL_CONTROL_GETPROPERTY control "FontSize"))
              (IF (> fontsize 0)
                (DCL_CONTROL_SETPROPERTY control "FontSize" (- 0 fontsize))
              )
            )
          )
        )
      )
    )
    (DCL_PROJECT_SAVEAS project newodclpath password)
)

(SetOdclFontSizeUnscaled "project1.odcl" nil "C:/temp/project2.odcl")
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

velasquez

The function dcl_control_getproperties doesn't exist in BETA-4. 
Was the name of the function modified?

BazzaCAD

Hmmm that's strange, it's in the help file, but it's not in the ARX.
I'm sure it's a mistake. What say Owen. :)
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

owenwengerd

Owen Wengerd (Outside The Box) / ManuSoft