Author Topic: Where to Start? Select Text Xfer to Selected Attribute as Value  (Read 1719 times)

0 Members and 1 Guest are viewing this topic.

Chillme1

  • Newt
  • Posts: 57
  • Must learn to earn!
Where to Start? Select Text Xfer to Selected Attribute as Value
« on: January 23, 2015, 10:59:36 AM »
My task is to automate transfer of title block data from text-based data to block attribute-based data.

Has anyone tips on how to start to code this or have a similar routine to use as a pattern.
I assume that I must get the object(s)' DXF codes as a first step i.e. text, mtext, block attribute, etc. Correct?

My current idea on a workflow for this task would have the user copy the old contents into a new template-based DWG file.
Here is where there may be an area to improve on my idea: The uses would pick in an old-to-new sequence between the text (old or source) and the intended (new or destination) attribute target.

Thanks for your input!
Thanks, Clint
Mechanical Designer / Process Piping
AutoCAD Toolsets 2022
Newbie Betimes - LISP Programmer

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #1 on: January 23, 2015, 11:06:13 AM »
Most of the time, the less user input the less chance for errors.

I wonder if you could base the translation of text->attribute by location?  If the title block has always bein inserted at 0,0, then each text entity at a certain location could, in theory, be mapped to a certain attribute.
Tim

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

Please think about donating if this post helped you.

Chillme1

  • Newt
  • Posts: 57
  • Must learn to earn!
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #2 on: January 23, 2015, 12:23:47 PM »
That is a good point about eliminating human error: I am all for minimizing it. As most of our legacy drawings use the same style of title block, this may be a better route.
There are several one-off styles from various contractors as well.

I am thinking there may be two variants.

I may start with the method mentioned as the first variant

After it works as intended, I will modify the code to create the second variant that will include positional recognition of text and transfer/transform this to an attribute value.
Thanks, Clint
Mechanical Designer / Process Piping
AutoCAD Toolsets 2022
Newbie Betimes - LISP Programmer

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #3 on: January 23, 2015, 01:53:01 PM »
If you are working in the same drawing, then there has been code posted to "swap text" ( search that term ).  You can find routines that will allow you start the process.

Other than that I am not sure how you envision this working, as the user is going to need to know the something about the attribute they are filling out, either the tag or the prompt.  Prompts are not the easiest things to work with though, as they are not save with attribute references only with attribute definitions.  And, tags are more useful to programmers than they are to users.
Tim

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

Please think about donating if this post helped you.

Chillme1

  • Newt
  • Posts: 57
  • Must learn to earn!
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #4 on: January 26, 2015, 08:09:48 AM »
Hi T. Willey,

I will check out the 'swap text' suggestion.

It appears that I am indeed breaking some new ground with this initiative. I envision the workflow as follows:
Starting the routine in the old file with the old text-based title block, the user chooses from a list from a dialog box or command line a specific drawing border (with title and revision blocks), then...
The user will be  prompted from the command line for each of the data fields (as attribute tags).
The user then picks the text from the old/source to satisfy the prompt for these data fields/attributes to populate new title block or is allowed to skip those fields with no entries.

Does this sound reasonable?
Thanks, Clint
Mechanical Designer / Process Piping
AutoCAD Toolsets 2022
Newbie Betimes - LISP Programmer

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #5 on: January 26, 2015, 08:52:36 AM »
Sounds doable.

I would also allow the user to type in the value desired, not just either skip it or pick it.
Tim

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

Please think about donating if this post helped you.

Chillme1

  • Newt
  • Posts: 57
  • Must learn to earn!
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #6 on: January 26, 2015, 10:39:33 AM »
Ah yes, that is a good point! Your encouragement in this effort means much to me right now.
Thanks, Clint
Mechanical Designer / Process Piping
AutoCAD Toolsets 2022
Newbie Betimes - LISP Programmer

Chillme1

  • Newt
  • Posts: 57
  • Must learn to earn!
Re: Where to Start? Select Text Xfer to Selected Attribute as Value
« Reply #7 on: January 28, 2015, 04:11:34 PM »
Our bud, Lee McDonald, has already written a superb routine for my purposes. In fact, I had forgotten that I had previously downloaded it from his website, www.lee-mac.com ! Thank you, Lee and also to you, T. Willey, for your interest.
Thanks, Clint
Mechanical Designer / Process Piping
AutoCAD Toolsets 2022
Newbie Betimes - LISP Programmer