Jump to content

Enhanced Block Attribute Properties change at once.


Recommended Posts

Posted

Hello All,
 

I want to change block tag properties, I can change one by one as i showed in image but there are soo many i want change at once. how can I change linewieight of all at once.

I also attached drawing file sample.
Thank you.

 

1baa45dcb4fdc8560165d33fc3b2bfd0.png

Block Attribute Line weight.dwg

Posted

It looks like that block was created programmatically?

Quote

Command: ATTSYNC
This drawing contains no attributed blocks.

 

  • Like 1
Posted
16 hours ago, ronjonp said:

It looks like that block was created programmatically?

 

Yes, it was created with some other program, not with Autocad. So here how can I change it.

Posted

I'd simply change Standard text style to something like "Swiss 721 Lt BT" to make the text readable if that's what you're looking for. 

Posted (edited)

FORGET THIS ANSWER, SEE THE ONE BELOW "HAS ANYONE TRIED EDITING THE BLOCK TO ADD IN 3 NEW ATRIBUTES, CALL THEM PN.....". I RECKON THAT IS A QUICKER SOLUTION

 

 

How much work do you want to do to correct this? I might be tempted to recreate the blocks 'properly' and copy in the text to each?

 

 

You can perhaps create a new block (can be renamed later), say "NewDot" with the 3 attributes you want, PN, PD, ZC - should be a matter of moments and perhaps put in a simple default value for the attributes to let you select them after. Also for what I am dong below it might work to make them a specified colour (depends on the rest of the drawing, something that will stand out). You can change this later in the block definition the normal way

 

 Now all you need to do is make up a LISP to copy the text from one to the other.....

 

So this will paste a block "NewDot" with the origin at the origin of your block "DOT"" (you'll need to make NewDot of course)

 

(defun c:trythis ( / acount MySS MyEnt pt )
  (setq MySS (ssget "X" '((0 . "INSERT")(8 . "POINTS"))))
  (setq acount 0)
  (while (< acount (sslength MySS))
    (setq MyEnt (ssname MySS acount))
    (setq pt (cdr (assoc 10 (entget MyEnt))))
    (command "-insert" "NewDot" pt "" "" "")
    (command "_zoom" "_object" (ssadd MyEnt) "")
    (c:ctx)  ;;SEE NOTE BELOW
    (c:ctx)  ;;SEE NOTE BELOW
    (c:ctx)  ;;SEE NOTE BELOW
    (setq acount (+ acount 1))
  )
)

 

Lee Mac has a function, Copy, Swap Text, CTX (sorry, he has made some good stuff that works well), download that and you can 'ctx' each text from old to new to update your new texts, which is in the code above and the quickest copy-paste solution for now. In his code in the 'copyswaptext:main' function you have to disable a while loop to make this work as above

 

Someone somewhere will have a LISP to grab the old texts (in each MyEnt above) and insert them in the new block, I don't have a quick solution for that today

 

 

Anyway, fingers crossed this all worked and you now have 2 sets of blocks, Dot and NewDot, so just delete the original and see how that goes.

 

 

 

Anyway, if someone has a LISP to take the 3 old values and paste them in the new block as it is inserted that would be good

 

Edited by Steven P
  • Like 1
Posted
7 hours ago, tombu said:

I'd simply change Standard text style to something like "Swiss 721 Lt BT" to make the text readable if that's what you're looking for. 

that is one possibility, but it will change all texts style which are using 'standard' text style. if we create a new text style and want to apply that to block attributes it also can not be done at once for all blocks.

Posted
1 hour ago, Steven P said:

How much work do you want to do to correct this? I might be tempted to recreate the blocks 'properly' and copy in the text to each?

 

 

You can perhaps create a new block (can be renamed later), say "NewDot" with the 3 attributes you want, PN, PD, ZC - should be a matter of moments and perhaps put in a simple default value for the attributes to let you select them after. Also for what I am dong below it might work to make them a specified colour (depends on the rest of the drawing, something that will stand out). You can change this later in the block definition the normal way

 

 Now all you need to do is make up a LISP to copy the text from one to the other.....

 

So this will paste a block "NewDot" with the origin at the origin of your block "DOT"" (you'll need to make NewDot of course)

 

(defun c:trythis ( / acount MySS MyEnt pt )
  (setq MySS (ssget "X" '((0 . "INSERT")(8 . "POINTS"))))
  (setq acount 0)
  (while (< acount (sslength MySS))
    (setq MyEnt (ssname MySS acount))
    (setq pt (cdr (assoc 10 (entget MyEnt))))
    (command "-insert" "NewDot" pt "" "" "")
    (command "_zoom" "_object" (ssadd MyEnt) "")
    (c:ctx)  ;;SEE NOTE BELOW
    (c:ctx)  ;;SEE NOTE BELOW
    (c:ctx)  ;;SEE NOTE BELOW
    (setq acount (+ acount 1))
  )
)

 

Lee Mac has a function, Copy, Swap Text, CTX (sorry, he has made some good stuff that works well), download that and you can 'ctx' each text from old to new to update your new texts, which is in the code above and the quickest copy-paste solution for now. In his code in the 'copyswaptext:main' function you have to disable a while loop to make this work as above

 

Someone somewhere will have a LISP to grab the old texts (in each MyEnt above) and insert them in the new block, I don't have a quick solution for that today

 

 

Anyway, fingers crossed this all worked and you now have 2 sets of blocks, Dot and NewDot, so just delete the original and see how that goes.

 

 

 

Anyway, if someone has a LISP to take the 3 old values and paste them in the new block as it is inserted that would be good

 

Hi Steven,

There are a lot of blocks like this more than thousand. thank you for you suggestions and ways, these are so many steps I am afraid i may do many mistakes by making or gathering codes.

I wonder why we cannot pick more than one block with "EATTEDIT" command.

 

Thank you..

Posted

There is a lisp by Master @Lee Mac which is "AttModSuite" it has an option of edit attribute "edAtt" which has many thing to select but there only lineweight option is not available. I request to @Lee Mac if he has time to modify it then it will work.

Thank you in advance.

 

41231062448c8583fcaa56ce1d598293.png

Posted (edited)

And there is another from Lee Mac. Attribute colour which you can also modify.

 

Big hint for this on is to call it say, AttLW (for lineweight), you can modify the DCL box if you want (now or later) and then look to the line which changes the colour, uses something like (vla-put-color (cdr pair) *attcolour*) and you might guess that vla-put-lineweight does something similar, and maybe guessing that *attcolour* could be replaced by the line weight you want to use.

 

Select all the blocks, run your new or modified LISP and hit the 'select all' button in the DCL and off it goes, lineweight as you want

 

 

 

 

...I'd still go with my answer above though for all the pieces of text. someone will be able to grab the text and past it into the blocks from their LISP libraries

 

Edited by Steven P
  • Like 2
Posted
6 hours ago, Saqib_theleo said:

that is one possibility, but it will change all texts style which are using 'standard' text style. if we create a new text style and want to apply that to block attributes it also can not be done at once for all blocks.

In the drawing you posted Standard was the only style, you could change the font to Swiss 721 Lt BT then use the RENAME command to change text style Standard to Swiss 721 Lt BT.

You could also use Ctrl+X _cutclip to cut and paste the blocks you want modified to a new drawing and set just them to Swiss 721 Lt BT.

  • Like 2
Posted

Or maybe get whoever created the initial program that makes these uneditable blocks to revise it so it doesn't create this problem.

 

If a program is mimicking Autocad's abilities, is it too much to expect them to do it properly?

  • Like 1
  • Agree 2
Posted (edited)

and finally, has anyone tried editing the block, adding 3 attributes, lets call them say PN, PD and ZC, then using attsync and see what happens?

 

 

image.thumb.png.ffeede6a8d35279e6de4f4d3b04ac31e.png

Edited by Steven P
  • Like 1
Posted
20 hours ago, Steven P said:

And there is another from Lee Mac. Attribute colour which you can also modify.

 

Big hint for this on is to call it say, AttLW (for lineweight), you can modify the DCL box if you want (now or later) and then look to the line which changes the colour, uses something like (vla-put-color (cdr pair) *attcolour*) and you might guess that vla-put-lineweight does something similar, and maybe guessing that *attcolour* could be replaced by the line weight you want to use.

 

Select all the blocks, run your new or modified LISP and hit the 'select all' button in the DCL and off it goes, lineweight as you want

 

 

 

 

...I'd still go with my answer above though for all the pieces of text. someone will be able to grab the text and past it into the blocks from their LISP libraries

 

Yes, that is also a good lisp. but as I told I am not good at writing or making major changing in Lisp codes.

Posted
15 hours ago, tombu said:

In the drawing you posted Standard was the only style, you could change the font to Swiss 721 Lt BT then use the RENAME command to change text style Standard to Swiss 721 Lt BT.

You could also use Ctrl+X _cutclip to cut and paste the blocks you want modified to a new drawing and set just them to Swiss 721 Lt BT.

Yes even we change text style but properties lineweight will remain same that will not change. but to show on drawing we can use this method in case.

Posted
9 hours ago, Dahzee said:

Or maybe get whoever created the initial program that makes these uneditable blocks to revise it so it doesn't create this problem.

 

If a program is mimicking Autocad's abilities, is it too much to expect them to do it properly?

yes this is possible that who created these using some program must see what if they are not editable in Autocad in case if we want to change in future. I think it is possible if they create again with proper setup then there is no problem.

Posted
5 hours ago, Steven P said:

and finally, has anyone tried editing the block, adding 3 attributes, lets call them say PN, PD and ZC, then using attsync and see what happens?

 

 

image.thumb.png.ffeede6a8d35279e6de4f4d3b04ac31e.png

Nice one, I tried like you said and it works. Thanks for your suggestion and thinking.

  • Like 2
Posted
19 hours ago, Saqib_theleo said:

Nice one, I tried like you said and it works. Thanks for your suggestion and thinking.

Do this and also change your lineweight to 0.30 mm or put them on a layer that has the correct lineweight.

Posted (edited)
15 hours ago, ronjonp said:

Do this and also change your lineweight to 0.30 mm or put them on a layer that has the correct lineweight.

Yes it changes to Default lineweight and also if we want to change it to some other than default we can change it using "Battman" command. before it was not possible.

Edited by Saqib_theleo

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...