.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Finding block location in each layout (or current only)

3 REPLIES 3
Reply
Message 1 of 4
Mike.Wohletz
479 Views, 3 Replies

Finding block location in each layout (or current only)

Hello
I have been struggling with how to retrieve a block (by name) location in the active layout. I am working on locating a part list line item in a drawing and I always want it to come in under the last one. I am currently using the code from Jerry Winters book. Any help in telling me why I always get the lowest block in all the layouts would be a big help.
Thanks Edited by: MIKE.WOHLETZ on Oct 27, 2009 1:56 AM
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Mike.Wohletz

There are a few ways you can go.

You can get the block table record of the block you want, and then use the method ' GetBlockReferenceIds '. This will get you all the object id's for all the inserted block references.

For the current space, you could use a selection set, and filter for the block name and the current tab name.

You could use a selection set, and filter for just the block name, and get all the block references in all spaces for said block.

You could step through the layout dictionary, and then each layout's definition, and grab the blocks yourself filtering as you want.
Message 3 of 4
Anonymous
in reply to: Mike.Wohletz

Well, that book isn't going to help you.

What you want to do is fairly complicated for someone new to
the .NET API. You have to get all the insertions of the block,
(which can be done using a selection filter), and then look at
each block insertion's Y ordinate, and select the one with the
lowest value.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6278510@discussion.autodesk.com...
Hello
I have been struggling with how to retrieve a block (by name) location in
the active layout. I am working on locating a part list line item in a
drawing and I always want it to come in under the last one. I am currently
using the code from Jerry Winters book. Any help in telling me why I always
get the lowest block in all the layouts would be a big help.
Thanks

Edited by: MIKE.WOHLETZ on Oct 27, 2009 1:56 AM
Message 4 of 4
Mike.Wohletz
in reply to: Mike.Wohletz

Tony
That is currently what I am doing, and I can get the y value, but if I use this in the first Layout tab and then attempt to use it again in the second Layout tab my block is inserted as if the blocks from the first Layout tab were in the second Layout tab.
Bottom line is that I don’t know how to filter the space of the blocks before I get the y value.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost