HI everybody , i just wondering about Grid..

Started by mycino, September 27, 2009, 06:48:49 AM

Previous topic - Next topic

mycino

well, hi everybody !:)   i live in korea and i heared ABout OpenDcl from Autdeks International User Group and i used to make some stuff application for my company.

Oneday, i sould  changed so many attribute name(kind of block of attributes..). so i made application for my job.(like a image )

but it just worked only one single attributed....it was really so simple routines...

i want to improve this application  by Grid box..

when i  addstring to first column..it was added up but. when i try addstring to next column..it doesn't works... i mean i couldn't addeup other strings to next columns...

i don't know why it doesn't worked.

my source is like this :

(defun c:laycon_laycon_OnInitialize (/ nRow laycont laylist)
  (dcl_Control_SetEventInvoke laycon_laycon_layconsub 1); define dcl controler...to events..
  (vl-load-com) 
(setq lays (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object))))
(vlax-for lay lays
(setq laylist (append laylist (list (vla-get-Name lay))))
)
  (setq laycont 0)
  (repeat (length laylist)
  (setq laygrid (nth laycont laylist))
(dcl_Grid_AddString laycon_laycon_layconsub laygrid));;;<<<<<<<<<<<<<<<   this line have some problems... i don't know why i can't added up next columns..
(setq laycont (+ laycont 1)) ;repeat add string to grid....
)

);end add string to grid


thanks for readed my article :)





Fred Tomke

Hi, mycino, I like working with grid very much. To help you it would be great if you upload the odcl-file. Thanks.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

mycino

hi :) Fred

thanks for your adviced.. about my atricle.. and.

i just add up  my layertool source and odcl file..

:) thans fred...

Fred Tomke

Hi, mycino, what shall happen if I activate the option buttons at the top of the form?

For using dcl_Grid_AddString you give a long string with all texts for all cells in a single row (see help).
Example:
Code (autolisp) Select
(dcl_Grid_AddString MyProj_MyForm_MyGrid "Column1Text|Column2Text|Column3Text" "|")

Another way would be to use Grid_AddRow. In this case you would call this function with a list of strings (see help).
Example:
Code (autolisp) Select
(dcl_Grid_AddRow MyProj_MyForm_MyGrid (list "Column1Text" "Column2Text" "Column3Text"))

A more individual way would be to add a string for the first column and to configure each cell afterwards. This is maybe neccessary if not all cells in a single column are using the same CellStyle.

Code (autolisp) Select
(if (setq intRow (dcl_Grid_AddString MyProj_MyForm_MyGrid "Column1Text"))
  (progn
    (setq oLayer (vla-item oLayerCollection "Column1Text"))
    (dcl_Grid_SetRowData MyProj_MyForm_MyGrid intRow (vla-get_objectID oLayer))
    (dcl_Grid_SetCellCheckState MyProj_MyForm_MyGrid intRow 1 (if (= (vla-get-layeron oLayer) :vlax-true) 1 0))
  ); progn
); if


Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

mycino

#4
Thansk for you adviced to my article..

Well, i added up Only one column...... i wanna more add up others columns...

i couldn't exactly what is cause about it...

so i attached my lisp sourced for it and Odcl file.. .so... please test it for somthing stuff( :)

A point of my questions

>1) HOw can more add up other column. (like images "OldValue" )....

>2) HOw can i get cell text from Grid.....?



Thanks readed my article :)

Fred Tomke

Hi, mycino,

I suggest you to have a look at the help. Here you can find everything about grid.
For adding a column you can use dcl_Grid_AddColumns. For reading cell content you can use dcl_Grid_GetCellText for a single cell or dcl_Grid_GetRowCells for all cells in one row.

I hope that brings much more light into the dark.  ;)

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]