Jump to content
Sign in to follow this  
andyer

setting the status of a block/Superblock programmatically

Recommended Posts

O learned denizens of the Activate forum,

 

Is there a way to set the status of a block (Superblock in this case) programmatically?   (e.g. to do this via GUI, right click on a block to select Status --> On/Off).  I would like to control the topology of my model via some scripting if possible and wondering if I can do this by controlling the status (or if you have another suggestion I'm open to it, too).

 

Cheers,

 

Andy

Share this post


Link to post
Share on other sites

Looks like I figured it out with some trial and error.  If the name of my block is 'SuperBlock', then you can do this with the following commands which deactivate (status = off) or activate, respectively:

 

> bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'off')

> bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'on')

Share this post


Link to post
Share on other sites

Here's a couple of commands to help you get the Full name of blocks:

 

First, select the block you want by clicking on it.  Then in the command window, use:

 

blk=bdeGetSelectedBlock(bdeGetCurrentDiagram)

 

bdeGetBlockFullName(blk)

 

Voila!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×