News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

sys(36) and Block command

Started by bdeck, September 04, 2016, 12:37:37 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

bdeck

How does one hide the dialog in the BlockDefine command?
Setting sys(36) does not seem to work for that dialog.

[EDIT]

Oops, adding this parameter to the BlockDefine command defeats the dialog:

<WaitForOK 0

It also defeats the permission dialog where BlockDefine forces an overwrite or an explode to allow a self referencing overwrite.

bd

Lar

If you don't have the <Name parameter then the dialog will still open even with the  <WaitForOK 0 parameter.

Quote from: bdeck on September 04, 2016, 12:37:37 PM
It also defeats the permission dialog where ... or an explode to allow a self referencing overwrite.
I'm not exactly sure what you're saying here but I think the <Type parameter takes care of it.

Eg:

>BlockDefine
{
<Name "1"
<Type 1      '0='convert to block' (turn the selected entities into an instance of the block), 1='retain' (keep the selected entities as original entities), 2='delete' (delete the selected entities after using them to define the block)
<WaitForOk 0
}



Lar

bdeck

#2
Quote from: Lar on September 04, 2016, 06:58:55 PM
If you don't have the <Name parameter then the dialog will still open even with the  <WaitForOK 0 parameter.

Hi Lar,  Good point.

Quote
Quote from: bdeck on September 04, 2016, 12:37:37 PM
It also defeats the permission dialog where ... or an explode to allow a self referencing overwrite.
I'm not exactly sure what you're saying here but I think the <Type parameter takes care of it.

If you instantiate an existing block MyBlock, select that instance plus some other entities, and then define a new block named MyBlock made up of the total selection, DC will normally present two dialogs, one to overwrite the existing MyBlock definition, and the other to ask if you want to explode the potentially self-referenced MyBlock instance before defining the new MyBlock.   

The "<WaitForOk 0" line defeats both dialogs. Very useful.

bd

(Guess I should have posted this in the sdk part of the forum.)

Lar

Quote from: bdeck on September 04, 2016, 09:52:14 PM
and the other to ask if you want to explode the potentially self-referenced MyBlock instance before defining the new MyBlock.   
So if someone is attempting to re-define an existing block with an instance of that existing block in the new definition then dcad gives them a slap on the wrist instead of knocking them upside dey head. Kool.

Lar

bdeck

Quote from: Lar on September 05, 2016, 06:13:14 AM
So if someone is attempting to re-define an existing block with an instance of that existing block in the new definition then dcad gives them a slap on the wrist instead of knocking them upside dey head. Kool.

;D  I agree that this is a behavior from which one might normally want to be protected. But if one is putting that functionality into a macro, DC apparently presumes one has given the matter some thought, and steps aside. That's OK with me.

I had thought that using a modifiable uninstantiated block as a data repository might be a crude, but effective kludge to store macro data in a DC file, except that DC offers no way to lock the data block to prevent it from being inadvertently purged.

Also if one is using the insertion points of attributes as point data, there is no way to query that data without exploding the block. That's ok, too,  but a parameter to query/change insertion points of attributes and attribute definitions would be preferable.


Rob S

Have you considered using the new custom properties as your data repository?

I was wondering what that feature might be useful for, so maybe...

Seem to remember the release notes for v26/2016 provide read-write macro access to these.
User since forever

Lar

Quote from: bdeck on September 05, 2016, 09:01:25 AM
... except that DC offers no way to lock the data block to prevent it from being inadvertently purged.
Exactly! I always stayed away from blocks since there is no way to protect them from being purged or inadvertently overwritten. The new Block Editor has encouraged me to explore blocks but the guillotine is still hanging overhead.

Quote from: Rob S on September 05, 2016, 11:02:06 AM
Seem to remember the release notes for v26/2016 provide read-write macro access to these.
Pages 9 to 13 of the Release Notes for dc2016 (Help menu) cover basiccad code for the new custom properties. Further on there's info on OLE and stuff like that.

Lar

bdeck

#7
Quote from: Rob S on September 05, 2016, 11:02:06 AM
Seem to remember the release notes for v26/2016 provide read-write macro access to these.

Rob, Lar.

Thanks,

I'm using insertion points of attributes as temporary holders for point data just so I don't have to fuss with text/floating point conversions. Despite that minor issue, the new custom properties look very interesting.

For the current project, It would not be catastrophic if a block were to be inadvertently purged, but it would be nice in general to be able to disable the purge command for uninstantiated blocks. A persistent sys() flag for that purpose would be great.

bdeck

Quote from: Rob S on September 05, 2016, 11:02:06 AM
Have you considered using the new custom properties as your data repository?

Rob,

Thanks for tip on the new custom properties. I've had more time to look at them now. A very useful and well-thought-out addition to the DC macro arsenal. Way easier than kludging a block into service, and much more flexible. (Thanks, DT).

Lar

Warning: Entities with 'custom properties' are not compatible with previous versions so if you open the file in dc25 or earlier the entities will stop loading once one with custom properties is encountered. The file will not be corrupted but if you save the file the rest of the entities are gone for good.

To get around this you can 'save-as' (from dc2016) to a previous version but this will get rid of the custom properties in the 'saved-as' file (the entities themselves will remain).

Lar