Author Topic: Is it possible to draw TABLE Border with lisp?  (Read 11535 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Swamp Rat
  • Posts: 637
Is it possible to draw TABLE Border with lisp?
« on: February 17, 2011, 04:34:44 AM »
Hello
my question like in subject. is it possible to draw border over some table cells?
for example, we cross window over some cells and outside or inside border are drawn.

thanks,
regards
kruuger

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #1 on: February 18, 2011, 11:27:05 AM »
Could you provide an image of what you are looking to achieve?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #2 on: February 18, 2011, 11:46:39 AM »
Out of curiosity I was messing around with the Table methods...

How does one successfully use the GetSubSelection method?  :?

I either get 'nil' or an error with everything I try...

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #3 on: February 18, 2011, 12:44:01 PM »
Hi Lee
maybe i should asked for table grid not border.

we start on first picture. we "draw" window over table cell.

after that program change grid to outside around two cells.

thanks
kruuger

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Is it possible to draw TABLE Border with lisp?
« Reply #4 on: February 18, 2011, 05:12:05 PM »
Out of curiosity I was messing around with the Table methods...

How does one successfully use the GetSubSelection method?  :?

I either get 'nil' or an error with everything I try...

Looks like something has to set the sub selection.  If you set it, then you can get it.  Confused?

Code: [Select]
Command: (vla-setsubselection ob2 0 1 0 1)
nil

Command: (vla-getsubselection ob2 'rmi 'rma 'cmi 'cma)
nil

Command: !rmi
0

Command: !rma
1

Command: !cmi
0

Command: !cma
4

The reason why ' cma ' is 4 is because the top row is a header row, and all the cells are merged.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #5 on: February 18, 2011, 05:58:18 PM »
Looks like something has to set the sub selection.  If you set it, then you can get it.  Confused?

Your example helped a lot Tim -

If you select the cells of a table (as Kruuger describes), then call the GetSubSelection method with output variables as in your example, such variables reflect the user's cell selection:



Code: [Select]
obj = <VLA Table Object>

(vla-getsubselection obj 'r1 'r2 'c1 'c2)

(list (cons r1 r2) (cons c1 c2))

==> ((1 . 2) (1 . 2))

Thanks Tim  :-)



Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #6 on: February 18, 2011, 06:09:42 PM »
Looking at your diagram Kruuger, I'm thinking a combination of the GetSubSelection method and the SetCellGridColor method. The part that puzzles me is how to pause for the user to make a 'SubSelection'.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #7 on: February 18, 2011, 06:38:07 PM »
Looking at your diagram Kruuger, I'm thinking a combination of the GetSubSelection method and the SetCellGridColor method. The part that puzzles me is how to pause for the user to make a 'SubSelection'.
i'm not sure if i follow but it should be easier to make subselection when user click over cells. i'm right?
kruuger

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #8 on: February 18, 2011, 07:10:14 PM »
Looking at your diagram Kruuger, I'm thinking a combination of the GetSubSelection method and the SetCellGridColor method. The part that puzzles me is how to pause for the user to make a 'SubSelection'.
i'm not sure if i follow but it should be easier to make subselection when user click over cells. i'm right?

But how would the routine pause for such a subselection, or, equally how would the routine be called if the user has made a subselection?

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #9 on: September 16, 2011, 08:09:00 PM »
Looking at your diagram Kruuger, I'm thinking a combination of the GetSubSelection method and the SetCellGridColor method. The part that puzzles me is how to pause for the user to make a 'SubSelection'.
i'm not sure if i follow but it should be easier to make subselection when user click over cells. i'm right?

But how would the routine pause for such a subselection, or, equally how would the routine be called if the user has made a subselection?
back to table border again :)
finally got subselection the way exactly i want.
now i need to study SetCellGridColor.
i seems to be a lot of work to create a list of "edge cell" and then set correct grid edge  :|

kruuger

GDF

  • Water Moccasin
  • Posts: 2081
Re: Is it possible to draw TABLE Border with lisp?
« Reply #10 on: September 19, 2011, 10:48:01 AM »
I tried your routine and get the following error:
** Invalid point **
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is it possible to draw TABLE Border with lisp?
« Reply #11 on: September 19, 2011, 12:10:39 PM »
Out of curiosity I was messing around with the Table methods...

How does one successfully use the GetSubSelection method?  :?

I either get 'nil' or an error with everything I try...
I have used vla-selectsubregion successfully, please see the attached LISP routine for an example.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #12 on: September 19, 2011, 02:23:33 PM »
I tried your routine and get the following error:
** Invalid point **
hmm, tomorrow i will try on 2011 but i don't see any problem on 2012.
table needs to be visible on screen. it is only way to get a table ENAME clicking inside cell (using ssget "_F")
error is when picking first or second corner ?

Out of curiosity I was messing around with the Table methods...

How does one successfully use the GetSubSelection method?  :?

I either get 'nil' or an error with everything I try...
I have used vla-selectsubregion successfully, please see the attached LISP routine for an example.

but this one only work when doing crossing window over table. sometimes i need to select only one cell.
also there is an error? can't pick any text. only type at command line.
kruuger

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is it possible to draw TABLE Border with lisp?
« Reply #13 on: September 19, 2011, 05:58:53 PM »
I can pick text and I will look into what I can come up with, this is something that could be useful here too.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is it possible to draw TABLE Border with lisp?
« Reply #14 on: September 19, 2011, 06:59:56 PM »
Here is my attempt at this. I think it could benefit from some more error handling, but I think this should give the basics of what you are trying to accomplish.

Please note that you can select a single cell, as long as it has content within it. You can also select multiple cells by clicking on any blank area of a cell in the corner.

I think this should give a good start to what you are asking for, I know it will help me with another routine.

Please let me know what you think.