Jump to content

block color


LISP2LEARN

Recommended Posts

Suggest you swap the order. Select object first then prompt for color:

 

Why you wanna swap the order for the input ?

 

 

 

Current code lost the ability to recognize Effective name against anonymous name on selection:

 

Are you sure ?

Link to comment
Share on other sites

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    10

  • pBe

    6

  • LISP2LEARN

    5

  • Lee Mac

    3

Why you wanna swap the order for the input ?

It doesnt make sense to select a color if there are no objects selected

 

Are you sure ?

 

Aboslutely

, if you happen to select a block with anonymous name [DB blocks], thats the only block updated and worse if it has attributes its hosed.

Link to comment
Share on other sites

It doesnt make sense to select a color if there are no objects selected

 

Even if you have selected nothing after choosing the colour , codes would run for nothing to do / which is in the safe way .

 

Aboslutely

, if you happen to select a block with anonymous name [DB blocks], that s the only block updated and worse if it has attributes its hosed.

 

I did not go that far because the OP question was not indicating to that kind of blocks . :)

 

But it is not that difficult to add some functions to get the effective name of the DB then cycle through entities to change the color or vlax-invoke 'Getattributes to change the color of attributes as I have used them in mine .

 

EDIT: by the use of my sub-routines (ExploreBlocks) (PaintTheWorld ) .

:D

Link to comment
Share on other sites

Even if you have selected nothing after choosing the colour , codes would run for nothing to do / which is in the safe way .

 

Exactly my point. so the time spent selecting the color is all for nothing

 

I did not go that far because the OP question was not indicating to that kind of blocks . :)

 

Better have and not need than need and not have. ;)

Link to comment
Share on other sites

 

Better have and not need than need and not have. ;)

 

So we should think of commercial programs all the time when we being in need of any codes . :)

Link to comment
Share on other sites

So we should think of commercial programs all the time when we being in need of any codes . :)

 

Well. not really, you did say "efficient" did you not?

 

Dont worry about it Tharwat.

 

Cheers dude.

 

BTW: it looks as if the slected blocks does indeed have an attribute. you assign the color not just once but twice

 

might as well loose these lines

(foreach x (vlax-invoke
  (vlax-ename->vla-object sn) 'Getattributes
                                )
                       (vla-put-color x color)
                     )

Edited by pBe
Link to comment
Share on other sites

  • 2 months later...
For what it's worth, attached is my take on this task.

 

The attached program will allow the user to modify the colour property of all objects (residing on unlocked layers) within multiple blocks defined in a drawing.

 

The program will work with standard, attributed and dynamic blocks.

 

Lee

 

 

This is the perfect piece of code which will revolutionise the way we produce drawings in our office - just wanted to say a huge thank you to you Lee, brilliant stuff, as always.

Link to comment
Share on other sites

This is the perfect piece of code which will revolutionise the way we produce drawings in our office - just wanted to say a huge thank you to you Lee, brilliant stuff, as always.

 

You're very welcome sammy - I'm delighted to hear that you can make use of the program in your office. :)

 

Cheers!

Link to comment
Share on other sites

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...