Routine to set transparency
Hi,Wondering if any one has clue how transparency of elements in 'block' can be defined 'byblock'. Coming from Revit i have files with a overkill of blockdefinitions i just want to convert this way.
ps
I have posted a question similar in regards to mr. Gile Fixblock routine, but this doesn't seem possible back then..) (vlax-for obj blkDefObj (vla-put-entitytransparency obj "BYBLOCK")) For vanilla route it looks like group code 440 is for transparency:
((-1 . ) (0 . "LINE") (330 . ) (5 . "2B4") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "VLD_AnnotateLINES") (100 . "AcDbLine") (10 -14.3023 -208.701 0.0) (11 239.348 -97.2689 0.0) (210 0.0 0.0 1.0))_$ ((-1 . ) (0 . "LINE") (330 . ) (5 . "2B5") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "VLD_AnnotateLINES") (440 . 33554572) (100 . "AcDbLine") (10 197.342 -405.725 0.0) (11 434.836 -405.725 0.0) (210 0.0 0.0 1.0))
In the above 2 line entities were compared, where one had trasparency value of 45. From what I understood vla-put-transperancy does NOT exist in AutoCAD, Roy.
Searched for it in various resources in vain. I would think some. Refedit, select all, command properties.
Where to start? Try searching with the correct function name: vla-put-entitytransparency. Ok. Good catch.
Can you show me how can it be used on a block ? Byblock.. Instead of 0-90..
http://www.theswamp.org/index.php?topic=44517.0 Try this generic function:
; (NestedPutProp "MyBlk" 'entitytransparency "BYBLOCK"); (NestedPutProp "MyBlk" 'color 3)(defun NestedPutProp (nme prop val / blk) (if (and (not (vl-catch-all-error-p (setq blk (vl-catch-all-apply 'vla-item (list (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) nme ) ) ) ) ) (= :vlax-false (vla-get-islayout blk)) (= :vlax-false (vla-get-isxref blk)) ) (vlax-for obj blk (vlax-put obj prop val)) )) have a look at these results
(vla-get-entitytransparency obj)"ByLayer"(vla-get-entitytransparency obj)"50" Roy,
I tried it in this code. No succes.Are you sure this works on nesting? Not in my AutoCAD
A solllution would be not to apply it on 'Mytempblck' put to all blocks in the SS selection..
(defun C:TRBB (/ SS XS YS RA) (setvar "cmdecho" 0) (setq SS (ssget)) (if (= XS NIL) (setq XS 1) ) ;_ end of if (if (= YS NIL) (setq YS 1) ) ;_ end of if (if (= RA NIL) (setq RA 0) ) ;_ end of if (command"block""MytempBlk" "0,0" SS "")(command"insert""MytempBlk" "0,0" XS YS RA "") (NestedPutProp "MytempBlk" 'entitytransparency "BYBLOCK"); ALL blocks in SS (command"explode" "l" "purge""b""MytempBlk" "n") )@Bigal
Something just like it can be found, vla-put- but i'm just don't know you to apply some code like this. .. Sorry, beyond my skills.. ;-)
[*](defun SetEntityTransparency (entity transparency / typ)
[*](if (or (and (= 'STR (setq typ (type transparency)))
[*] (= "BYLAYER" (strcase transparency))
[*] )
[*] (and (= 'INT typ) (vla-object entity)
[*] transparency
[*] )
[*] )
[*] )
[*])
By the way, i notice some strange behaviour
wanting to reset "ByBlock" back to "Bylayer".. (file attached)
Is 'Transparency Byblock' supported or not ??
In BricsCAD V17 is does act normal
In AutoCAD 2017 with my tools it switches back to 'byblock'
In AutoCAD 2017 without any loaded lisps
In AutoCAD 2018 beta without loaded loaded
Really seems like a BUG to me..
??
strange transparency.dwg
页:
[1]
2