One way is to use the Block name with an asterisk at the beginning, which puts it in pre-exploded. I don't know whether you can do that in the (vlax-invoke-method) approach, but if you use the Insert command, you can:
(command "_.insert" (strcat "*" bname) '(0 0 0) 1 0)
[I used 0,0,0 as described at the top of the file, rather than 35.5,0.5,0 as in the code -- use what you really want.]
Note that when you Insert something pre-exploded, you only get to give it one scale factor, not three.
Or, you can follow the insertion with an Exploding of the last object.
@Kent1Cooper wrote:....
(command "_.insert" (strcat "*" bname) '(0 0 0) 1 0)
....
Or, you can follow the insertion with an Exploding of the last object.
It occurred to me that one big advantage of Inserting something pre-exploded, as compared to Inserting it and then Exploding it, is that the former brings the pieces of the Block into the drawing, but does not bring in the Block definition. So there's no memory consumed by that, and no need to purge all such Block definitions if you want to minimize the file size.
But what some might, under certain circumstances, consider a disadvantage is that if there's already a Block by that name in the drawing, it will not ask whether you want to redefine it. If you want a definition from outside the drawing under those conditions, you would need to put the asterisk before the complete filepath and name, not just the Block name.
Thank you Kent1Cooper, I thought this would be a simple editing but it turned out not . I will search a little more for a lisp that explode last object on all layouts.
@Patchy wrote:Thank you Kent1Cooper, I thought this would be a simple editing but it turned out not . I will search a little more for a lisp that explode last object on all layouts.
It might be possible with simple editing. I'm not familiar enough with the (vlax-invoke-method) approach, but others can probably say. It could be as simple as using (strcat "*" bname) in place of bname, if you can do a pre-exploded one with that method, or invoking Explode on each newblk after putting it in.
(progn (setq blk (vla-get-block x)) (vla-explode (vlax-invoke-method blk 'insertblock (vlax-3d-point '(35.5 0.5 0.0)) bname 1.0 1.0 1.0 0.0)))