Pick Buttons and Grid

Started by Emiliano, April 18, 2012, 04:25:03 AM

Previous topic - Next topic

Emiliano

Hello everyone,
is the first time I use the GRID object and I have some questions:

1. I enter into a cell, a distance. I'd like to enter the value directly or click on Pick Buttons launch a function that allows you to select two points on the AutoCAD screen. Unfortunately, if active style Pick Buttons, on the cell, the user can not enter the value directly, but is obligated to press the button: You can enable the same cell, the double type of input?

2. Alternatively I thought about putting two columns, one for the manual insertion of value and the other with a Pick Buttons allows you to override the value of the first column selecting two points on the AutoCAD screen. This system works but I do not like it because, the Pick Buttons are hidden and appear only when you click on the cell. you can make the Pick Buttons always visible even for cells that are not current?

3. You can add a colored background to some cells or some rows or some columns?

Thanks in advance

Fred Tomke

Hi,

I solved that by using an pick-icon instead of a button in the second column. Picking the icon will force the user to select a distance in the drawing.

No, you can't set a background color to several cells.

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

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

Emiliano

Hello Fred,
thanks for the answer.

You mean I have to set the image of the Pick Button in the "Cell Icon"? See attached picture.
That cell style, I set? I tried with "6-String" and "8-Integer" but when the user clicks the image it is ruined by an indication of the current cell ...

Then I wrote this function
Code (autolisp) Select

(defun c:App_FormName_Grid1_OnBeginLabelEdit (Row Column /)
  (if (= Column 10)
    (progn
      (setq dist (getdist "\nInsert lenght: "))(princ "\n")
      (if (/= dist nil)
        (progn
          (setq dist (rtos dist 2 2))
          (dcl_Grid_SetCellText App_FormName_Grid1 Row 9 dist)
          (dcl_Grid_SetCurCell App_FormName_Grid1 Row 9)
        )
      )
    )
  )
)



Let me know if I understand correctly...

Emiliano

I managed to solve my problem by setting the style of the cell to "3-Switchable Image" and setting the correct icons.

Now I have another problem, corny, but I could not solve:
- You can set a cell to entering real numbers, with the comma?  ???

Thanks in advance

Fred Tomke

Hi, no, OpenDCL only supports the style like AutoCAD is using: point as decimal delimiter.

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

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

Emiliano

Thanks for the reply.

I expressed myself badly ....
I meant real number: point or comma is indifferent.

I tried with:
- 8-Integer: but properly does not accept decimal
- 6-String: I put the decimals, but I do not like because it allows the inclusion of letters
- 7-Angle Unit: works well, but if the user inserts the letters appears the error message "Invalid value of the angle": the measure is a distance and then this error is not good.

There is a style that allows the inclusion of real numbers?
or do I have to use 6-String and verify the correctness of the input through code?  :'(

Fred Tomke

Hi, try style 9 for Units. I've translated it in the DEU release to decimals.

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

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

Emiliano

Perfect!
thanks

I'm sorry but I had not seen :-(