.NET

Reply
Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 1 of 10 (205 Views)

How can I get the Blockname inserted before I select the point on the drawing?

205 Views, 9 Replies
03-21-2013 01:02 AM

Hello everyone, I have a problem. I select one block to insert . However,how can I get the Blockname before select the insered point?

I found the BlockTableRecord.BlockInsertionPoints event. It is meaning that  it can only apply to the whole BlockTableRecord type rather than some individual block references (AutoCAD INSERTs)

Is there any other event?

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 2 of 10 (202 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 01:32 AM in reply to: kevinsir

kevinsir wrote:

... I select one block to insert... However,how can I get the Blockname before select the insered point?


How you select block?


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 3 of 10 (191 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 01:50 AM in reply to: Alexander.Rivilis

Maybe there is an error. I mean inserting a new BlockReference. I select the  block on the menu ! 

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 4 of 10 (181 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 02:38 AM in reply to: kevinsir

kevinsir wrote:

Maybe there is an error. I mean inserting a new BlockReference. I select the  block on the menu ! 


What kind of menu? If you need help please explain this in details. Maybe with pictures...


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 5 of 10 (175 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 03:00 AM in reply to: Alexander.Rivilis

menu 'insert'--"block"  then select one block from the combobox. Click the accept button then select the insert point on the paper. the problem is that  i want to get the block name by code before select the point.

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 6 of 10 (171 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 03:25 AM in reply to: kevinsir

I could be wrong, but if you're trying to get the name of the block in an INSERT command before a insertion point specified, then you will not do such. It is possible only if block is from other dwg-file and in this case Database.BeginInsert event is occurring.

Think about what you want to do after and find another way.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 7 of 10 (148 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 06:14 PM in reply to: Alexander.Rivilis

Your ideas may be a solution. However I want to do something individually by name of the blockrecord before  a new blockReference inserted!

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 8 of 10 (140 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-21-2013 11:44 PM in reply to: kevinsir

kevinsir wrote:

Your ideas may be a solution. However I want to do something individually by name of the blockrecord before  a new blockReference inserted!


In this case look like you have to replace command INSERT with your's own command. I do not know what "something individually by name of the blockrecord"  you want to do, but may be that can be done not before, but after inserting of block?


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 9 of 10 (111 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-24-2013 05:22 PM in reply to: kevinsir

You're attempting to solve a larger problem using approaches that are myopic.

 

You can't for example, tell a user that they must use the INSERT dialog to insert blocks because your solution to the problem only works in that context.  IOW, there are many ways to insert a block besides the INSERT dialog, and the INSERT dialog allows the user to enter an insertion point in the dialog before they even choose the block.

 

IOW, it won't work.

 

Try describing the larger problem whcih leads you to believe that the way to solve the the problem is by handling events, because in my experience, that is usually not the best solution.

Valued Contributor
kevinsir
Posts: 78
Registered: ‎08-20-2012
Message 10 of 10 (75 Views)

Re: How can I get the Blockname inserted before I select the point on the draw

03-27-2013 08:59 PM in reply to: DiningPhilosopher
Thanks, DiningPhilosopher ! I will try other ways !
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.