Author Topic: Codes for adding an Object to a Block  (Read 5562 times)

0 Members and 2 Guests are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Codes for adding an Object to a Block
« Reply #15 on: November 29, 2010, 01:04:59 PM »
My main problem is that how to insert the selected entity to the Block at the same location that it is existed in dwg.

^^ Should do what you want

Hi Lee.

Your routine is doing very well , but in your routine you used lots of subentities that it needs a long time to make things clear to me to understand.
And that's why I did mention in the begining I am not looking for a complete routine.

So could you please enlighten at the codes that cover my needs over the thread ?

Thanks

There isn't just one line of code to add objects to the block - else I would have just used one line myself. The objects need to be properly transformed before adding them to the block definition, the methods I use (CopyObjects) have already been discussed in this thead.
« Last Edit: November 29, 2010, 01:18:20 PM by Lee Mac »

Coder

  • Swamp Rat
  • Posts: 827
Re: Codes for adding an Object to a Block
« Reply #16 on: November 29, 2010, 01:20:51 PM »

The objects needs to be properly transformed before adding them to the block definition.

Yeah... what is that transform ( from and where to  :-) ) ?

Thanks

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Codes for adding an Object to a Block
« Reply #17 on: November 29, 2010, 01:26:15 PM »

The objects needs to be properly transformed before adding them to the block definition.

Yeah... what is that transform ( from and where to  :-) ) ?

A translation from the object position relative to the selected block in Model/Paperspace, and rotation/scaling to account for block scale & rotation, to the Block Definition Geometry.

Coder

  • Swamp Rat
  • Posts: 827
Re: Codes for adding an Object to a Block
« Reply #18 on: November 29, 2010, 01:34:15 PM »
The objects needs to be properly transformed before adding them to the block definition.
Yeah... what is that transform ( from and where to  :-) ) ?

A translation from the object position relative to the selected block in Model/Paperspace, and rotation/scaling to account for block scale & rotation, to the Block Definition Geometry.

Exactly and defintely .  :wink:

That's what I would like to know and that's why I started my thread for.

Hope you show me these codes ?
if you do not mind of course .

Appreciated.


Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Codes for adding an Object to a Block
« Reply #19 on: November 29, 2010, 02:16:34 PM »
The objects needs to be properly transformed before adding them to the block definition.
Yeah... what is that transform ( from and where to  :-) ) ?

A translation from the object position relative to the selected block in Model/Paperspace, and rotation/scaling to account for block scale & rotation, to the Block Definition Geometry.

Exactly and defintely .  :wink:

That's what I would like to know and that's why I started my thread for.

Hope you show me these codes ?
if you do not mind of course .

Appreciated.



I have already shown you the code - it is downloadable from the link provided.