Jump to content

Recommended Posts

Posted

Ive being using ACad Mecanical for quite a while.But leaving it alone do to its unstable features.

 

It has a niffty feature tho, For blocks

Where when you rededit close, you have an opertunity to rename the block and/ or change base point.

 

I wish to replicate this, for now with just an extra button on the refedit toolbar.So

1. Can you ,with a reator, pause a command, and run a routine(dcl box)?

So that When you hit refclose, It will put up with this box, before

Closing.

 

I am trying to get a copy of all enities in a block,

2.How do i get this selection set? that will select the enities only in the block?

 

I was going to use "enselnp",But that will get what was in the block, not what currently is in it. aka new lines and circles.

 

3.Would i just simple copy this to the clipboard?

 

If i did this,

4. how would i get these entities, (entlast) pick's the last item, not the entire selection.(did think paste as block then rename, but how would i copy with basepoint, while in refedit?, Should i remove out of block, copy with base point, & disregard changes?)

 

So that i can the create the block with the new point(if changed)

Or/and new name.

Would do this with a normal block command.

 

 

Or even better

5.Does any one have some thing like this

or

6.Does any one know how to read autocads main files, to extract this list?

 

 

Thanks help for any help/suggestions.

Posted

This may help get you started, returns a list of Entities (enames), that make up a block:

 

[i][color=#990099];; GetBlockEntities   by Lee McDonnell   [07.05.09][/color][/i]

[i][color=#990099];; ARGS:[/color][/i]
[i][color=#990099];; Blk   ~  Block Name [str][/color][/i]

[i][color=#990099];; RETURN:[/color][/i]
[i][color=#990099];; List of Entities (Enames)[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] GetBlockEntities  [b][color=RED]([/color][/b]Blk [b][color=BLUE]/[/color][/b] tStr[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"BLOCK"[/color][/b] Blk[b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b]GetObj [b][color=RED]([/color][/b][b][color=BLUE]tblobjname[/color][/b] [b][color=#ff00ff]"BLOCK"[/color][/b] Blk[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

[i][color=#990099]; Get Sub-Entities from Table Def[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] GetObj  [b][color=RED]([/color][/b]bObj[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] bObj [b][color=RED]([/color][/b][b][color=BLUE]entnext[/color][/b] bObj[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] bObj [b][color=RED]([/color][/b]GetObj bObj[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

Posted

Lee,

 

Will that not return what is in a block,

 

aka not the current block,

Because if im changing the name, i dont want what ive done in my current block to be saved as its current name.

 

thanks for the input

Posted
Lee,

 

Will that not return what is in a block,

 

aka not the current block,

Because if im changing the name, i dont want what ive done in my current block to be saved as its current name.

 

thanks for the input

 

This will return the entities that make up the block definition in the block table.

 

I'm not really sure of your requests.

Posted

Yes, It will. But it will returns what is saved, correct?

 

What im after is what is currently in the block,

As in,

You enter a block, draw a line, that line is not part of that block till i save the block.

i want to select that line as well as every thing eles in the block, before i save it. So that i can Not save/but close it, and use those items to make a new block.

 

Are you with me?

I know i suck at this explaining thing.

 

 

regards

Flower

Posted

flowerrobot,

 

Attached is a much simpler program that makes its own blocks. You can use this for a reference to get started. The lists created from the program above can be used to make your block reference.The attached program was made with the program in the previous post.

It has only three blocks in it of different shapes with attributes just to keep it simple to learn.

 

Good Luck

SL.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...