Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy a block from an xref

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
1852 Views, 10 Replies

Copy a block from an xref

Good morning,

I have a drawing with an xref attached. The xref has some blocks. I would
like to insert one of these blocks into the current drawing that already
exists inside the xref.

Ultimately I want to create a function with lisp where the user can select a
visible block in an xref and it will insert in the current drawing.

Before I create some brain damage here, is there already a way to do this?

Thanks,
Mark
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

You can use the express one 'ncopy' to copy it in place.

--

Tim
"A blind man lets nothing block his vision."


"Mark Ingram" wrote in message
news:5538467@discussion.autodesk.com...
Good morning,

I have a drawing with an xref attached. The xref has some blocks. I would
like to insert one of these blocks into the current drawing that already
exists inside the xref.

Ultimately I want to create a function with lisp where the user can select a
visible block in an xref and it will insert in the current drawing.

Before I create some brain damage here, is there already a way to do this?

Thanks,
Mark
Message 3 of 11
Anonymous
in reply to: Anonymous

XBIND. You should be able to make a lisp routine using (nentsel) to get the
name of a selected block from the Xref, then use that name in XBIND to get
it into the current drawing's Block list, then Insert it. [But I don't have
something like already built.]
--
Kent Cooper


"Mark Ingram" wrote...
Good morning,

I have a drawing with an xref attached. The xref has some blocks. I would
like to insert one of these blocks into the current drawing that already
exists inside the xref.

Ultimately I want to create a function with lisp where the user can select a
visible block in an xref and it will insert in the current drawing.

Before I create some brain damage here, is there already a way to do this?

Thanks,
Mark
Message 4 of 11
Anonymous
in reply to: Anonymous

Never knew about that command Kent. Thanks for point it out.

--

Tim
"A blind man lets nothing block his vision."


"Kent Cooper" wrote in message
news:5538494@discussion.autodesk.com...
XBIND. You should be able to make a lisp routine using (nentsel) to get the
name of a selected block from the Xref, then use that name in XBIND to get
it into the current drawing's Block list, then Insert it. [But I don't have
something like already built.]
--
Kent Cooper


"Mark Ingram" wrote...
Good morning,

I have a drawing with an xref attached. The xref has some blocks. I would
like to insert one of these blocks into the current drawing that already
exists inside the xref.

Ultimately I want to create a function with lisp where the user can select a
visible block in an xref and it will insert in the current drawing.

Before I create some brain damage here, is there already a way to do this?

Thanks,
Mark
Message 5 of 11
Anonymous
in reply to: Anonymous

Never knew about xbind. That should get me going in the right direction,
that you very much.

Mark
Message 6 of 11
Anonymous
in reply to: Anonymous

Sometimes it pays to have been using AutoCAD since 1984, as long as my mind
still functions well enough to remember some of those less common commands
now and then....
--
Kent Cooper


"Mark Ingram" wrote...
Never knew about xbind. That should get me going in the right direction,
that you very much.

Mark
Message 7 of 11
Anonymous
in reply to: Anonymous

Kent,

I guess XBIND is OK if you don't mind the fact the block name will be something like
this, "Site Miscel OP4C$0$TS-14" rather than its original name "TS-14".

If you want the original name, you'd have to test whether that block name already
exists. And rename it if not.

Tim,

NCOPY copies nested objects. You cannot use it to copy a block from an xref into the
active file. It simply copies the deepest nested object selected. And BTW as an
ExpressTool, I'm not sure it's totally reliable.

There are other ways to do what Mark asked for...

Joe Burke


"Kent Cooper" wrote in message
news:5538527@discussion.autodesk.com...
Sometimes it pays to have been using AutoCAD since 1984, as long as my mind
still functions well enough to remember some of those less common commands
now and then....
--
Kent Cooper


"Mark Ingram" wrote...
Never knew about xbind. That should get me going in the right direction,
that you very much.

Mark
Message 8 of 11
Anonymous
in reply to: Anonymous

Joe,

Thanks for clarifing that. Since I wrote my own, I don't use 'ncopy', but
I thought you could change the settings on it like other express tools.

--

Tim
"A blind man lets nothing block his vision."


"Joe Burke" wrote in message
news:5538681@discussion.autodesk.com...
Kent,

I guess XBIND is OK if you don't mind the fact the block name will be
something like
this, "Site Miscel OP4C$0$TS-14" rather than its original name "TS-14".

If you want the original name, you'd have to test whether that block name
already
exists. And rename it if not.

Tim,

NCOPY copies nested objects. You cannot use it to copy a block from an xref
into the
active file. It simply copies the deepest nested object selected. And BTW as
an
ExpressTool, I'm not sure it's totally reliable.

There are other ways to do what Mark asked for...

Joe Burke


"Kent Cooper" wrote in message
news:5538527@discussion.autodesk.com...
Sometimes it pays to have been using AutoCAD since 1984, as long as my mind
still functions well enough to remember some of those less common commands
now and then....
--
Kent Cooper


"Mark Ingram" wrote...
Never knew about xbind. That should get me going in the right direction,
that you very much.

Mark
Message 9 of 11
Anonymous
in reply to: Anonymous

Hi Tim,

I think it's fairly silly 2008 can read and write Microstation files while Autodesk
continues to ignore the copy from xref functionality Microstation had since day one.

You wrote your own as I did. It needs a lot of custom code because the matrix
returned by nentselp only describes the deepest object selected. Which is useless if
you want to copy a block from an xref. At that point you need rocket science code to
generate a transformation matrix given only a block ename.

I wish Autodesk would wake up so I could chuck all my custom code. Copying things
from an xref should be no big deal.

Regards
Joe


"T.Willey" wrote in message
news:5538701@discussion.autodesk.com...
Joe,

Thanks for clarifing that. Since I wrote my own, I don't use 'ncopy', but
I thought you could change the settings on it like other express tools.

--

Tim
"A blind man lets nothing block his vision."
Message 10 of 11
Anonymous
in reply to: Anonymous

I was going to rename the block and merge the layers to get rid of the $0$
nonsense, but I seem to be having issues with xbind itself. I started a new
thread.

Thanks for your comments Joe.
Mark
Message 11 of 11
Anonymous
in reply to: Anonymous

Getting BOUNDARY to work on closed polygons shouldn't be a big deal either
but it is.

Obviously, there are certain things that the programmers at Autodesk are
simply incapable of fixing.

"Joe Burke" wrote in message
news:5538776@discussion.autodesk.com...
Hi Tim,

I think it's fairly silly 2008 can read and write Microstation files while
Autodesk
continues to ignore the copy from xref functionality Microstation had since
day one.

You wrote your own as I did. It needs a lot of custom code because the
matrix
returned by nentselp only describes the deepest object selected. Which is
useless if
you want to copy a block from an xref. At that point you need rocket science
code to
generate a transformation matrix given only a block ename.

I wish Autodesk would wake up so I could chuck all my custom code. Copying
things
from an xref should be no big deal.

Regards
Joe


"T.Willey" wrote in message
news:5538701@discussion.autodesk.com...
Joe,

Thanks for clarifing that. Since I wrote my own, I don't use 'ncopy', but
I thought you could change the settings on it like other express tools.

--

Tim
"A blind man lets nothing block his vision."

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

Post to forums  

Autodesk Design & Make Report

”Boost