Author Topic: Get field code within a table's cell  (Read 2142 times)

0 Members and 1 Guest are viewing this topic.

Rabbit

  • Guest
Get field code within a table's cell
« on: May 10, 2011, 11:41:20 AM »
I tried using vla-get-text but all I got was the result of the field, not the field code.  The field code is the area of a lwpolyline .  I'm wanting to get the objectid of the lwpolyline so that I can select the lwpolyline later on in the routine.  So basically, I want to input the column & row of a table object and retrieve the lwpolyline object and/or entity info.

Sincerely,
Rabbit

BlackBox

  • King Gator
  • Posts: 3770
Re: Get field code within a table's cell
« Reply #1 on: May 10, 2011, 02:01:40 PM »
This will work for a table cell:

Code: [Select]
(defun c:GetCellFieldCode  ( / eText oText)
  (princ "\rGET CELL FIELD CODE ")
  (vl-load-com)
  (if (and (setq eText (car (nentsel)))
           (vl-position (cdr (assoc 0 (entget eText))) '("MTEXT" "TEXT"))
           (setq oText (vlax-ename->vla-object eText))
           (vlax-method-applicable-p oText 'fieldcode))
    (prompt
      (strcat
        "\n\nFieldCode value is: \n\n\t\t\""
        (vla-fieldcode oText)
        "\"\n"))
    (prompt "\n** Invalid selection ** "))
  (princ))

Edit - This doesn't give you exactly what you want, but it's the best i can do for the moment.
"How we think determines what we do, and what we do determines what we get."

Hugo

  • Bull Frog
  • Posts: 431
Re: Get field code within a table's cell
« Reply #2 on: July 27, 2012, 01:35:48 AM »
Hallo
 
Why do I get an error message when I click in the box A

Warum bekomme ich eine Fehlermeldung wenn ich in das Feld A klicke


Danke
« Last Edit: July 27, 2012, 01:55:58 AM by Hugo »

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Get field code within a table's cell
« Reply #3 on: July 27, 2012, 04:46:59 AM »
Hallo
 
Why do I get an error message when I click in the box A

Hi ,

You should select the Text itself inside the cell to get the string . :wink:

Hugo

  • Bull Frog
  • Posts: 431
Re: Get field code within a table's cell
« Reply #4 on: July 27, 2012, 05:07:27 AM »
Hallo

Yes I did get back but a Nile
Ja habe ich gemacht bekomme aber ein Nil zurück