How do you select a block reference in a specific Layout?

How do you select a block reference in a specific Layout?

Anonymous
Not applicable
153 Views
4 Replies
Message 1 of 5

How do you select a block reference in a specific Layout?

Anonymous
Not applicable
How do you select a block reference in a specific Layout? I'm trying to
create a program that updates title block attributes. The problem lies in
having 2 or more Layouts all with the same title block. I can't seem to
find a way of selecting a block reference based on what layout it is in.
I've currently tried to use selection set filters which work until I try to
select based on group code 410. A entget in LISP reports the Layout Name in
group code 410. The group code table shows 410 mapped to a string which
doesn't seem to represent the layout name but just a user defined string
group code.
Thanks for any help in advance.
0 Likes
154 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
As you have already discovered, group 410 doesn't work in VBA. Here are two
possible solutions:

1) Iterate the Layouts collection, iterating each of their blocks in turn
2) Use the FilterLayout routine available in the Visual Basic section of my
web site. It will get you entities from specific layouts. It also shows how
to determine which layout an item is contained in.

--
Visit me at http://www2.stonemedia.com/franko

"Andrew Armstrong" wrote in message
news:ef06cc2.-1@WebX.SaUCah8kaAW...
> How do you select a block reference in a specific Layout? I'm trying to
> create a program that updates title block attributes. The problem lies in
> having 2 or more Layouts all with the same title block. I can't seem to
> find a way of selecting a block reference based on what layout it is in.
> I've currently tried to use selection set filters which work until I try
to
> select based on group code 410. A entget in LISP reports the Layout Name
in
> group code 410. The group code table shows 410 mapped to a string which
> doesn't seem to represent the layout name but just a user defined string
> group code.
> Thanks for any help in advance.
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
okay, finally success. THANKS!
I should of asked this question first.

"Frank Oquendo" wrote in message
news:ef06cc2.0@WebX.SaUCah8kaAW...
> As you have already discovered, group 410 doesn't work in VBA. Here are
two
> possible solutions:
>
> 1) Iterate the Layouts collection, iterating each of their blocks in turn
> 2) Use the FilterLayout routine available in the Visual Basic section of
my
> web site. It will get you entities from specific layouts. It also shows
how
> to determine which layout an item is contained in.
>
> --
> Visit me at http://www2.stonemedia.com/franko
>
> "Andrew Armstrong" wrote in message
> news:ef06cc2.-1@WebX.SaUCah8kaAW...
> > How do you select a block reference in a specific Layout? I'm trying to
> > create a program that updates title block attributes. The problem lies
in
> > having 2 or more Layouts all with the same title block. I can't seem to
> > find a way of selecting a block reference based on what layout it is in.
> > I've currently tried to use selection set filters which work until I try
> to
> > select based on group code 410. A entget in LISP reports the Layout Name
> in
> > group code 410. The group code table shows 410 mapped to a string which
> > doesn't seem to represent the layout name but just a user defined string
> > group code.
> > Thanks for any help in advance.
> >
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Always remember: sometimes it's the questions you *don't* ask. LOL. Glad to
hear you finally got your problem solved.

--
Visit me at http://www2.stonemedia.com/franko

"Andrew Armstrong" wrote in message
news:ef06cc2.1@WebX.SaUCah8kaAW...
> okay, finally success. THANKS!
> I should of asked this question first.
0 Likes
Message 5 of 5

Anonymous
Not applicable
>I've currently tried to use selection set filters which work until I try to
>select based on group code 410. A entget in LISP reports the Layout Name in
>group code 410. The group code table shows 410 mapped to a string which
>doesn't seem to represent the layout name but just a user defined string
>group code.

Andrew,

in AutoLISP the 410 group contains the user-selected name of the
layout the object is contained in, while the 330 group contains the
entity name of the corresponding block record (e.g. *PAPERSPACE2).

In ActiveX Automation you'll find the layout an object is contained in
by using the OwnerID property. The document object's ObjectIDtoObject
method translates this ID to a AcadBlock object which in turn gives
you access to the layout and its properties.

Dietmar Rudolph

President, CR/LF GmbH, http://www.crlf.de
Vice-President Europe, CADLock, Inc. http://www.cadlock.com
Webmaster, AutoCAD Developers Group Europe, http://www.adge.org
Member of the Autodesk Discussion Forum Moderator Program

Author, "Mastering AutoCAD 2000 Objects", http://www.crlf.de/Verlag/PublishingServices.html
0 Likes