Author Topic: (vla-ismergedcell) 7 arguments?  (Read 3613 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
(vla-ismergedcell) 7 arguments?
« on: December 16, 2011, 11:34:51 AM »
The function (vla-ismergedcell) has 7 arguments:
Code: [Select]
(vla-ismergedcell tableObject row col minRow maxRow minCol maxCol)Can anybody explain this?

I would understand this:
Code: [Select]
(vla-ismergedcell tableObject row col)Or this:
Code: [Select]
(vla-ismergedcell tableObject minRow maxRow minCol maxCol)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vla-ismergedcell) 7 arguments?
« Reply #1 on: December 16, 2011, 12:00:50 PM »
Ima gonna guess it's to be interpretted as ... "for the cell at row and col, return true if it is a merged cell of the range defined by minRow, minCol ...".
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: (vla-ismergedcell) 7 arguments?
« Reply #2 on: December 16, 2011, 12:09:26 PM »
IMO the function would be better if minRow / maxRow / minCol / maxCol were output parameters returning the range of cells that are merged for the supplied cell at Row / Col.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vla-ismergedcell) 7 arguments?
« Reply #3 on: December 16, 2011, 12:10:42 PM »
totally agree, they was drinking funny water the day they penned that function signature
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vla-ismergedcell) 7 arguments?
« Reply #4 on: December 16, 2011, 12:12:59 PM »
I've never executed said method, and there's scant documentation and no example (AutoCAD 2010 anyway). Maybe that's exactly the way it works Lee.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: (vla-ismergedcell) 7 arguments?
« Reply #5 on: December 16, 2011, 12:51:46 PM »
I've never executed said method, and there's scant documentation and no example (AutoCAD 2010 anyway). Maybe that's exactly the way it works Lee.

I haven't tried it either; the documentation doesn't specify the parameters as output and the function has a Boolean return value, but I should imagine this method is similar to the HitTest method.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: (vla-ismergedcell) 7 arguments?
« Reply #6 on: December 16, 2011, 01:04:09 PM »
Tested and confirmed.  8-)

Revised Function Documentation:

Code - Auto/Visual Lisp: [Select]
  1. (vla-IsMergedCell <TableObject> <row> <col> <minRow> <maxRow> <minCol> <maxCol>)

Arguments:

<TableObject>  -  VLA Table Object

<row> / <col>  -  The index of the cell to query

<minRow> / <maxRow> / <minCol> / <maxCol>  -  [output]  The range of merged cells.


Returns:

Type: Boolean

:vlax-true   -  cell at <row> / <col> is part of a merged range: (<minRow>, <maxRow> ; <minCol>,<maxCol>)

:vlax-false  -  cell at <row> / <col> is not part of a merged range


Example



[ Note that row / col indexes are zero-based ]

Code: [Select]
Command: (setq obj (vlax-ename->vla-object (car (entsel))))

Select object: #<VLA-OBJECT IAcadTable 0e8f951c>

Command: (vla-ismergedcell obj 2 0 'rmin 'rmax 'cmin 'cmax)
:vlax-true

Command: !rmin
2

Command: !rmax
3

Command: !cmin
0

Command: !cmax
1

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vla-ismergedcell) 7 arguments?
« Reply #7 on: December 16, 2011, 01:06:30 PM »
Good work Lee. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: (vla-ismergedcell) 7 arguments?
« Reply #8 on: December 16, 2011, 01:08:47 PM »

BlackBox

  • King Gator
  • Posts: 3770
Re: (vla-ismergedcell) 7 arguments?
« Reply #9 on: December 16, 2011, 01:16:56 PM »
Good work Lee. :)

1+

Make sure you PM a link of your post to Se7en so that it may be added to the recent LISP function Help feature.  :wink:
"How we think determines what we do, and what we do determines what we get."

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (vla-ismergedcell) 7 arguments?
« Reply #10 on: December 16, 2011, 03:56:23 PM »
Thank you Lee for clearing that up. Where would we be without you!

In BC this function is currently not compatible:
for the min and max arguments you can use any number (even a real) but NOT a quoted variable.

I did search theswamp for this (of course :-D) and found this bit of code:
Code: [Select]
(vla-ismergedcell tab lig col 0 0 0 0)

As you can guess BC has no problem with this. But how does AC cope with those four zeros?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: (vla-ismergedcell) 7 arguments?
« Reply #11 on: December 16, 2011, 05:40:09 PM »
Thank you Lee for clearing that up. Where would we be without you!

You're very welcome Roy, thanks!  8-)

But how does AC cope with those four zeros?

AC returns the boolean result without error.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (vla-ismergedcell) 7 arguments?
« Reply #12 on: December 17, 2011, 11:23:37 AM »
Thanks again Lee.