OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Peter2 on November 17, 2014, 03:29:50 AM

Title: "Blockview" - Display visibility of Dynamic block?
Post by: Peter2 on November 17, 2014, 03:29:50 AM
The "Subject" says it all:

Can "Blockview" display the visibility of a dynamic block?
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: 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.
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: Peter2 on November 17, 2014, 05:59:56 AM
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"?
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: roy_043 on November 17, 2014, 08:00:00 AM
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.
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: Fred Tomke on November 17, 2014, 08:08:23 AM
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
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: Peter2 on November 17, 2014, 09:05:48 AM
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  :)
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: roy_043 on November 17, 2014, 10:40:46 AM
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.
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: roy_043 on November 18, 2014, 12:16:29 AM
Note: for AutoCAD you need to add:
Code (autolisp) Select
(vl-load-com)
Title: Re: "Blockview" - Display visibility of Dynamic block?
Post by: roy_043 on November 18, 2014, 01:05:29 AM
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.