Author Topic: Using Object Data to label linework  (Read 4731 times)

0 Members and 1 Guest are viewing this topic.

cyclops

  • Newt
  • Posts: 22
Using Object Data to label linework
« on: July 05, 2016, 12:05:32 PM »
I am working with drawings with objectdata attached to the linework from a shape file, what i need is to automate the process of labeling the linework, by extracting multiple fields/data from the odjectdata, then labeling the linework with a multi-leader.

Does anyone have a lisp routine or other way to automate the process?

I need the process to be point and shoot, i am working with interns, enough said.

Thanks
Cy
It's 'O'Neill', with three L's!!!! (Jack O'Neill)

ChrisCarlson

  • Guest
Re: Using Object Data to label linework
« Reply #1 on: July 05, 2016, 12:21:12 PM »
There are numerous companies which you can contract to make this.

One such is
http://lee-mac.com/contact.html


cyclops

  • Newt
  • Posts: 22
Re: Using Object Data to label linework
« Reply #2 on: July 05, 2016, 12:54:22 PM »
Chris,
I am working to that end but admin is requesting an example, prior to allocating monies.

I need to know if what I have asked is possible.

Thanks,
Cy
It's 'O'Neill', with three L's!!!! (Jack O'Neill)

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Using Object Data to label linework
« Reply #3 on: July 05, 2016, 12:55:52 PM »
I am working with drawings with objectdata attached to the linework from a shape file, what i need is to automate the process of labeling the linework, by extracting multiple fields/data from the odjectdata, then labeling the linework with a multi-leader.

Does anyone have a lisp routine or other way to automate the process?

I need the process to be point and shoot, i am working with interns, enough said.

Thanks
Cy

Use MAP  it has features just for this sort of thing.  They are called Map Annotation Templates.

Demo version of MAP = FREE
Be your Best


Michael Farrell
http://primeservicesglobal.com/

cyclops

  • Newt
  • Posts: 22
Re: Using Object Data to label linework
« Reply #4 on: July 05, 2016, 01:04:30 PM »
mjfarrell,
I have worked a little with map annotation templates, to label parcels but that was an en mass method, is there a way to selectively to label singular objects as needed?

Thanks,
Cy
It's 'O'Neill', with three L's!!!! (Jack O'Neill)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #5 on: July 05, 2016, 01:16:50 PM »
It's possible.
What discipline/version of cad are you using?
I extract object data from imported SHP data quite often.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

cyclops

  • Newt
  • Posts: 22
Re: Using Object Data to label linework
« Reply #6 on: July 05, 2016, 01:25:03 PM »
alanjt,
I am using civil3d 2012-2016. I have also, but on the fly labeling seems more complex than en mass labeling.

Thanks,
Cy
It's 'O'Neill', with three L's!!!! (Jack O'Neill)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #7 on: July 05, 2016, 01:33:07 PM »
alanjt,
I am using civil3d 2012-2016. I have also, but on the fly labeling seems more complex than en mass labeling.

Thanks,
Cy
Cool.
I assume you have a specific set of fields you want to extract for labeling. All one needs is a list, and it can easily be extracted.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

cyclops

  • Newt
  • Posts: 22
Re: Using Object Data to label linework
« Reply #8 on: July 05, 2016, 03:40:03 PM »
alanjt,
Yes, i am pulling 8 fields from a set of 30+.
The fields may change, i can make a different anno label for different needs?

Thanks,
Cy
It's 'O'Neill', with three L's!!!! (Jack O'Neill)

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Using Object Data to label linework
« Reply #9 on: July 06, 2016, 08:16:00 AM »
alanjt,
I am using civil3d 2012-2016. I have also, but on the fly labeling seems more complex than en mass labeling.

Thanks,
Cy

Just create your annotation templates and apply as needed

Yes it works well en mass via a query operation,
however it also can be applied selectively

further annotation labels can later be converted to text if that is desired.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Using Object Data to label linework
« Reply #10 on: July 06, 2016, 11:18:57 PM »
You can also start by running manual MAPQUERY, to demonstrate the time needed to manually extract/label... Then leverage the seldom documented ADE_* LispFunctions to accomplish same in less time.

I used to do this back when we worked with Land Desktop; I'll see if I can find some code snippets.



Cheers
"How we think determines what we do, and what we do determines what we get."

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #11 on: July 07, 2016, 08:40:56 AM »
Code: [Select]
(defun _getObjectData (ename / tables ass lst)
  (foreach table (setq tables (ade_odgettables ename))
    (foreach x (cdr (assoc "Columns" (ade_odtabledefn table)))
      (if (not (member (setq ass (cdr (assoc "ColName" x))) lst))
        (setq lst (cons ass lst))
      )
    )
  )
  (mapcar (function (lambda (x) (cons x (ade_odgetfield ename tables x 0))))
          (vl-sort lst '<)
  )
)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BlackBox

  • King Gator
  • Posts: 3770
Re: Using Object Data to label linework
« Reply #12 on: July 07, 2016, 09:41:26 AM »
Once I'm done extracting the Object Data I need, I usually get rid of it to keep the drawing size as small as possible:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:ODD () (c:ObjectDataDelete))
  2. (defun c:ObjectDataDelete (/ odTableName i n)
  3.   (princ "\rOBJECTDATADELETE ")
  4.   (if (and (setq odTables (ade_odtablelist))
  5.            (setq i (length odTables))
  6.            (setq n 0)
  7.            (princ "\nWorking, please wait... ")
  8.            (princ)
  9.       )
  10.     (progn
  11.       (foreach odTableName (ade_odtablelist)
  12.         (ade_oddeletetab odTableName)
  13.         (setq n (1+ n))
  14.       )
  15.       (princ "Done. ")
  16.       (prompt
  17.         (strcat "\nRemoved "
  18.                 (itoa n)
  19.                 " of "
  20.                 (itoa i)
  21.                 " object data table"
  22.                 (if (= 1 i)
  23.                   ". "
  24.                   "s. "
  25.                 )
  26.         )
  27.       )
  28.     )
  29.     (prompt "\n** No object data tables found ** ")
  30.   )
  31.   (princ)
  32. )
  33.  
  34. ;; if not being loaded into map-enabled application
  35. (if (not ade_odtablelist)
  36.  
  37.   ;; disabled these functions
  38.   (setq c:ODD (setq c:ObjectDataDelete nil))
  39. )
  40.  
  41.  
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Using Object Data to label linework
« Reply #13 on: July 07, 2016, 10:14:36 AM »
Once I'm done extracting the Object Data I need, I usually get rid of it to keep the drawing size as small as possible:


This seems counter productive to me.  I think of all the time wasted putting object data onto the objects, only to have it deleted?
What happens when and or if that object data is ever needed again? 
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Using Object Data to label linework
« Reply #14 on: July 07, 2016, 10:46:08 AM »
Once I'm done extracting the Object Data I need, I usually get rid of it to keep the drawing size as small as possible:


This seems counter productive to me.  I think of all the time wasted putting object data onto the objects, only to have it deleted?
What happens when and or if that object data is ever needed again?

Then I just go back to the 'source' drawing where I've already imported the County's GIS/Shapefile data with Object Data, and cull what I need, of course (i.e., project length changes, etc.)... Otherwise, I can simply run MAPIMPORT as needed (i.e., newer Shapefile is available, etc.)... That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers
"How we think determines what we do, and what we do determines what we get."

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #15 on: July 07, 2016, 10:58:33 AM »
That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers
snap snap snap snap snap snap
                                     snap
                                snap
                           snap
                      snap
                 snap
            snap
       snap
  snap
snap snap snap snap snap snap
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Using Object Data to label linework
« Reply #16 on: July 07, 2016, 11:03:09 AM »
Once I'm done extracting the Object Data I need, I usually get rid of it to keep the drawing size as small as possible:


This seems counter productive to me.  I think of all the time wasted putting object data onto the objects, only to have it deleted?
What happens when and or if that object data is ever needed again?

Then I just go back to the 'source' drawing where I've already imported the County's GIS/Shapefile data with Object Data, and cull what I need, of course (i.e., project length changes, etc.)... Otherwise, I can simply run MAPIMPORT as needed (i.e., newer Shapefile is available, etc.)... That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers

Now that I see where your 'data' is coming from, that clears up the question of why you delete the object data.
A lot of the object data we deal with here is created, and added by us, so removing it seemed a foreign concept to me.

Thanks for the clarification.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Using Object Data to label linework
« Reply #17 on: July 07, 2016, 11:03:45 AM »
That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers
snap snap snap snap snap snap
                                     snap
                                snap
                           snap
                      snap
                 snap
            snap
       snap
  snap
snap snap snap snap snap snap
There was no SNAP there, or are you just being overly childish today?

Surprised you didn't try to type an "Around the world and behind my back snap" that would have been far more impressive.  equally childish, but more impressive to be sure.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #18 on: July 07, 2016, 11:10:02 AM »
That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers
snap snap snap snap snap snap
                                     snap
                                snap
                           snap
                      snap
                 snap
            snap
       snap
  snap
snap snap snap snap snap snap
There was no SNAP there, or are you just being overly childish today?
Just being overly childish and joking around. Lighten up.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BlackBox

  • King Gator
  • Posts: 3770
Re: Using Object Data to label linework
« Reply #19 on: July 07, 2016, 11:19:10 AM »
Thanks for the clarification.

No worries, MJF; now that I understand where your OD originates, I understand why you asked.


Cheers
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Using Object Data to label linework
« Reply #20 on: July 07, 2016, 11:22:27 AM »
That's only happened to me on 3 projects in the past 10 years, FWIW.


Cheers
snap snap snap snap snap snap
                                     snap
                                snap
                           snap
                      snap
                 snap
            snap
       snap
  snap
snap snap snap snap snap snap

 :-D  :mrgreen:  :angel:
"How we think determines what we do, and what we do determines what we get."

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using Object Data to label linework
« Reply #21 on: August 02, 2016, 05:09:13 PM »
Adding to thread for next person...

https://knowledge.autodesk.com/support/autocad-civil-3d/troubleshooting/caas/sfdcarticles/sfdcarticles/Importing-ESRI-Shape-files-and-label-features-using-Display-Manager-s.html

@Michael: Building on this post, is it possible to have it label with an expression as to include more than one field, like you can when linking to SHP data with MapWSpace?
« Last Edit: August 04, 2016, 09:10:02 AM by alanjt »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox