"Blockview" - Display visibility of Dynamic block?

Started by Peter2, November 17, 2014, 03:29:50 AM

Previous topic - Next topic

Peter2

The "Subject" says it all:

Can "Blockview" display the visibility of a dynamic block?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

roy_043

Not directly I think. But it is possible to create a temporary block, add an insert of the dynamic block to that block definition, set the correct visibility, and display the temporary block in a BlockView.

Peter2

Quote from: roy_043 on November 17, 2014, 04:51:27 AM
Not directly I think. But it is possible to create a temporary block, add an insert of the dynamic block to that block definition, set the correct visibility, and display the temporary block in a BlockView.
Also "on the fly" - at a "on_clicked_event"?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

roy_043

Quote from: Peter2 on November 17, 2014, 05:59:56 AM
Also "on the fly" - at a "on_clicked_event"?
Yes*, I have just tested this. Let me know if you need any help.
*Note: I work with BricsCAD.

Fred Tomke

Hi,
Quote from: Peter2 on November 17, 2014, 05:59:56 AM
Also "on the fly" - at a "on_clicked_event"?
it should work if you use vla-methods instead of commands.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Peter2

Quote from: roy_043 on November 17, 2014, 08:00:00 AM
Yes*, I have just tested this. Let me know if you need any help...
Any code-snippet is appreciated  :)
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

roy_043

Quote from: Peter2 on November 17, 2014, 09:05:48 AM
Any code-snippet is appreciated  :)
See the attached .zip file.
The function CreateTmpBlock creates anonymous blocks. These are hidden from the user, but are still present when the drawing is saved. When the drawing is reopened unused anonymous blocks are automatically deleted. If CreateTmpBlock is called many times the file size of the drawing will increase and you may then want to have your application erase them or want to reuse the same anonymous block definition.

roy_043

Note: for AutoCAD you need to add:
Code (autolisp) Select
(vl-load-com)

roy_043

Note 2: for AutoCAD you may have to change:
(vla-put-value a propValue)
To:
(vlax-put a 'value propValue)

BricsCAD is a little more flexible here.