Title: Re: Wblock to export a block and its layer
Post by: ChrisCarlson on November 28, 2016, 08:56:13 AM
WBLOCK is working as it is intended. The program is initiated in drawing "A", the block is saved as drawing "B", upon inserting drawing "B" into drawing "C" the entities will be inserted as a block identical to the one in drawing "A".
Title: Re: Wblock to export a block and its layer
Post by: Marc'Antonio Alessi on November 28, 2016, 01:24:35 PM
You should not have a file that contains a block that has the same name, you may have the "circular reference" problems...
Title: Re: Wblock to export a block and its layer
Post by: danallen on November 28, 2016, 07:26:00 PM
This lisp export blocks for files perfectly but the block is exploded I am wondering is there a way to export blocks as it is and its layer?
I agree with previous comments, but to do what you want, revise code during WBLOCK command to select entities such as the already inserted block, instead of using blockname (bn).
Title: Re: Wblock to export a block and its layer
Post by: HasanCAD on November 29, 2016, 05:54:48 AM
Thanks all for quick reply this final (up to my knowladge)
Title: Re: Wblock to export a block and its layer
Post by: ronjonp on November 29, 2016, 10:33:10 AM
FWIW, Your make directory within the AND statement will always return nil after the directory exists. Maybe use: (or (findfile (setq dir "C:\\Temp")) (vl-mkdir dir)) Also, don't set variables until you actually get into your program ( PROGN ).
Title: Re: Wblock to export a block and its layer
Post by: Tharwat on November 29, 2016, 03:25:19 PM
* Dynamic Blocks can not be selected the same way that regular blocks being selected with ssget function. * There is no need to test if the variable ss has selected objects tow times since it is already tested that in the first part with and function.
Title: Re: Wblock to export a block and its layer
Post by: Grrr1337 on November 29, 2016, 04:41:34 PM
I think you could wrap the entire thing with a single and function, after following ronjonp and Tharwat's advices.
Title: Re: Wblock to export a block and its layer
Post by: HasanCAD on December 03, 2016, 04:33:41 AM
Thanks all I'll follow
Title: Re: Wblock to export a block and its layer
Post by: HasanCAD on December 05, 2016, 06:50:25 AM
In some cases There are blocks not inserted So How to modify this lisp to insert all blocks even not inserted?
Title: Re: Wblock to export a block and its layer
Post by: ronjonp on December 05, 2016, 10:02:10 AM
Iterate the block table.
Title: Re: Wblock to export a block and its layer
Post by: ChrisCarlson on December 05, 2016, 10:28:32 AM