Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layer transparency and blocks

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
svucic
17628 Views, 6 Replies

Layer transparency and blocks

Hi everyone,

 

i'm trying to set the transparency of objects via autolisp. I'm using the following code:

 

(setq flag (tblsearch "LAYER" "Uklonjeno"))

				(if (= flag nil)
					(progn
					(command "Layer" "M" "Uklonjeno" "c" "red" "" "")
					(command "_LAYER" "_TR" 80 "Uklonjeno" "")
					(command "laymch" selnosacea "" "n" "Uklonjeno")
					)
					(progn
					(command "laymch" selnosacea "" "n" "Uklonjeno")
					)
				)

It creates the new layer and sets its transparency to 80 %. However the blocks thaht are moved to the new layer are not transparent. 

 

Due to compatibility reasons i'm working in 2000 version of dwg. 

[Edit] The blocks are saved as 2000 version dwg. The dwg I'm working in is no saved. The default save option is 2000.

6 REPLIES 6
Message 2 of 7
krzysztof.psujek
in reply to: svucic

...

It creates the new layer and sets its transparency to 80 %. However the blocks thaht are moved to the new layer are not transparent. 

 

 


Hi,

it seems you have problem with blocks.

Check transparency of objects within block definition. 

Set it to ByLayer and then should work.

 

If it's not the reason post your drawing it will be easier to diagnose. 

 

Chris

 

Message 3 of 7
svucic
in reply to: krzysztof.psujek

It's allready set to "ByLayer". Some blocks behave normal and some just wont show transparent. I can't find any difference between them. 

Here is the dwg and the  AutoCAD Block Reference Interface retrieved by VLAX-DUMP-OBJECT. I tried to compare the block that is showing transparent and the one that is not.

 

 

Message 4 of 7
dbroad
in reply to: svucic

Edit the block definitions and change the internal objects from layer znak to layer 0.  Then they will inherit the layer properties of the block.

Architect, Registered NC, VA, SC, & GA.
Message 5 of 7
svucic
in reply to: dbroad

That worked. Thank you!

 

Would it be possible to that trough autolisp or visual lisp instead trough block editor?

Message 6 of 7
krzysztof.psujek
in reply to: svucic

Hi,

first read this or some similar articles http://www.ellenfinkelstein.com/acadblog/on-which-layers-should-you-create-blocks/.

 

There are a lot of routines that move object within block to 0 layer, and for sure you could find at least few of them on this forum.

You can also check this LeeMac's great function http://lee-mac.com/applytoblockobjects.html 

and look at example usage of it.

 

Chris

Message 7 of 7
svucic
in reply to: krzysztof.psujek

Actually I didn't create the blocks, I got them from other source. And I just found Lee Mac's function and implemented it.  

 

Thanks to all! 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report