Author Topic: block=block - diesel fields do not update  (Read 8154 times)

0 Members and 1 Guest are viewing this topic.

airportman

  • Newt
  • Posts: 37
  • i customize when required
block=block - diesel fields do not update
« on: September 07, 2012, 01:46:53 PM »
I have about 100 drawings which use an existing titleblock.
I've now made changes to that titleblock (added some diesel fields to the attributes) and would like to update the drawings with my block=block lisp routine.
I have 2 attributes in the titleblock that I have changed to diesel expressions. when I do a block=block update routine, it does not bring in the FIELD diesel expressions from the new titleblock. How do I get this to work.  :|
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

owenwengerd

  • Bull Frog
  • Posts: 451
Re: block=block - diesel fields do not update
« Reply #1 on: September 07, 2012, 01:48:31 PM »
Use the ATTSYNC command.

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #2 on: September 07, 2012, 02:02:48 PM »
Have tried it. does not seem to work.
Have also tried using BATTMAN SYNC.
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #3 on: September 07, 2012, 02:05:45 PM »
I think it has something to do with the OBJECT ID ?   :|  :|
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

owenwengerd

  • Bull Frog
  • Posts: 451
Re: block=block - diesel fields do not update
« Reply #4 on: September 07, 2012, 02:11:48 PM »
You'll need to provide more details than "does not seem to work". What does it not do that you expect it to do? Is there an error message? Which version of AutoCAD are you using?

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #5 on: September 07, 2012, 04:55:12 PM »
hey owen. love your work with dcl.
what we have here is autocad v2010

the issue i am seeing is the diesel expression in the attribute will not update when i do a block = block update.
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

owenwengerd

  • Bull Frog
  • Posts: 451
Re: block=block - diesel fields do not update
« Reply #6 on: September 07, 2012, 08:49:39 PM »
Thanks. What is a diesel expression that will not update? What does it display, and what should it display?

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #7 on: September 09, 2012, 09:29:02 PM »
the diesel expression (inside a field) for an attribute that is in a titleblock. The diesel expression takes the drawing filename, strips off the ".dwg" portion and then populates the field. This information is then automatically updated anytime you change the filename or when you create a new drawing and use this in your template.

The issue is; the original titleblock did not have the diesel field in the attribute.
When i make the change to the template file and then insert it into the drawing file, you are asked "do you want to redefine the block".
With most blocks when this is performed, the block updates and you see the changes made.
This does not seem to be the case with the diesel expression field.

If you run the BATTMAN command and check the attribute values for the block, they indicate that the fields have changed.
When you hit the SYNC button, nothing happens to the existing block in the drawing.

any ideas would be great.   :realmad:
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

owenwengerd

  • Bull Frog
  • Posts: 451
Re: block=block - diesel fields do not update
« Reply #8 on: September 09, 2012, 11:05:58 PM »
Sorry, I guess I was not clear. I wanted to know what the expression is in the updated attribute, what it's displayed value is, and what you think it should be.

Redefining a block definition does not affect attributes because attributes are part of the block reference, not the block definition. The ATTSYNC commands updates a block reference.


If you update the attribute definition entities in the block definition, then sync the existing attributes to the new definitions, then evaluate the field, the existing attribute should then display the result of evaluating the updated expression.

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #9 on: September 10, 2012, 10:36:48 AM »
owen:

here is the the first expression:

$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),7))

and here is the second expression:

$(substr, $(getvar, dwgname),$(-,$(strlen, $(getvar, dwgname)),5),2)

I know that both work fine when i tested them directly in the titleblock. what I am not seeing is the data updating with I updated (redefine) the titleblock.
I have the flags set to 31.
I'm not new to this, but this roadblock is confusing. I might be looking for a variable or something.
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

Drafter X

  • Swamp Rat
  • Posts: 578
Re: block=block - diesel fields do not update
« Reply #10 on: September 10, 2012, 11:09:46 AM »
It may not do what you want the way you want, the diesel has already evaluated the value and gone to the great digital void, redefining the block wont cause it to reupdate. I have seen this before and its annoying, but have not figured out a way to make it re-evaluate the attribute.
CadJockey Militia Commander

mkweaver

  • Bull Frog
  • Posts: 352
Re: block=block - diesel fields do not update
« Reply #11 on: September 10, 2012, 12:04:24 PM »
I don't think this is going to work for you because the field is in the attribute value not in the attribute definition. Attsync does not change attribute values.  This is going to take some code to push the field into the value after you have redefined the block.

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #12 on: September 10, 2012, 12:34:58 PM »
its a field within the attribute definition.
The original definition was text. the new definition is diesel.
if i insert the block into the drawing, it comes in with the new definitions.
the trouble is that i have a ton of attributes already populated and i do not want to remove the data.

I know i can do this in 2 parts if needed.

1. I can write an odbx lisp to extract all the data
2. replace the titleblocks with the new titleblock
3. extract the handles for those new blocks
4. translate the data to the new handles
5. push it all back in

does anyone know something quicker? simpler?
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

owenwengerd

  • Bull Frog
  • Posts: 451
Re: block=block - diesel fields do not update
« Reply #13 on: September 10, 2012, 02:49:11 PM »
mkweaver is correct. I thought that ATTSYNC also updated the attribute value to reflect the new default value in the attribute definition, but the docs make it clear that it does not. This makes me wonder: how exactly did you update the attribute definition in the revamped title block definition? By changing the default value to the DIESEL expression? I'm just wondering if you didn't update an attribute in an instance of the title block and think this updates the definition.

In any case, you don't need to replace the existing title blocks, you just need to update the values of the attributes. If it's only one or two attributes, you can just update them using their tags to find them in the existing title blocks and hard code their new values in your code, without worrying about the block definition at all. If it needs to be more generic, you can do the same thing except use the updated block definition as the source instead of hardcoding the new values.

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: block=block - diesel fields do not update
« Reply #14 on: September 11, 2012, 12:43:15 PM »
here are some images of what i am dealing with.
The diesel expressions are in a field, inside the attribute definition.
when i insert the block into the drawing (with the same block), i get the redefine option and follow through (typical).
the next image i provided shows that same block in one drawing (the original on top).
As you can see the original will not update to show the fields.
any ideas?
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800