AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute value from block?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
179 Views, 4 Replies

Attribute value from block?

Anyone know if I can define a block with an attribute such that the default
value of the attribute is the elevation at which the block itself is
inserted? I want to insert a block at a specific elevation and have that
elevation labeled as part of the block.

Thanks,

Mark Scacco
Scacco Consulting, Inc.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Hi Mark,

Whether you do it manually or by Program the block has to be told the data
twice.

One approach would be to use ALDD points to insert the block and use a file
with the Point height as the description. You could create this using Excel
with a copy column process.

Otherwise you are going to have to program for what you want to happen.

There are lots of example of code for inserting a block and adding attribute
data in the help files, in the sample files and via the AutoCAD
customisation NGs.

--


Laurie Comerford
CADApps
www.cadapps.com.au


"Mark Scacco" wrote in message
news:C8D191912FB7E2E82F338DDADADD5193@in.WebX.maYIadrTaRb...
> Anyone know if I can define a block with an attribute such that the
default
> value of the attribute is the elevation at which the block itself is
> inserted? I want to insert a block at a specific elevation and have that
> elevation labeled as part of the block.
>
> Thanks,
>
> Mark Scacco
> Scacco Consulting, Inc.
>
>
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

Mark:

Try out the SPOT routine that's part of Cadlantic Custom Utilities. A 30-day evaluation version is available from the Downloads page of my site below.

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711

"Mark Scacco" wrote in message news:C8D191912FB7E2E82F338DDADADD5193@in.WebX.maYIadrTaRb...
> Anyone know if I can define a block with an attribute such that the default
> value of the attribute is the elevation at which the block itself is
> inserted? I want to insert a block at a specific elevation and have that
> elevation labeled as part of the block.
>
> Thanks,
>
> Mark Scacco
> Scacco Consulting, Inc.
>
>
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

Laurie,

Thanks for the feedback.

I was hoping something simple could be done, such as extracting the Z coord
from the InsertPoint ?variant? by entering a snippet of "code" for the
attribute Value.

Something like GetAttributes.varInsertPoint.

Obviously, at this point I'm just learning VBA, so please excuse my folly if
this is totally incorrect syntax.

Thanks,

Mark Scacco
Scacco Consulting, Inc.


"Laurie Comerford" wrote in message
news:250C380B4A13F1A9358CD53B8A6BE1E6@in.WebX.maYIadrTaRb...
> Hi Mark,
>
> Whether you do it manually or by Program the block has to be told the data
> twice.
>
> One approach would be to use ALDD points to insert the block and use a
file
> with the Point height as the description. You could create this using
Excel
> with a copy column process.
>
> Otherwise you are going to have to program for what you want to happen.
>
> There are lots of example of code for inserting a block and adding
attribute
> data in the help files, in the sample files and via the AutoCAD
> customisation NGs.
>
> --
>
>
> Laurie Comerford
> CADApps
> www.cadapps.com.au
>
>
> "Mark Scacco" wrote in message
> news:C8D191912FB7E2E82F338DDADADD5193@in.WebX.maYIadrTaRb...
> > Anyone know if I can define a block with an attribute such that the
> default
> > value of the attribute is the elevation at which the block itself is
> > inserted? I want to insert a block at a specific elevation and have
that
> > elevation labeled as part of the block.
> >
> > Thanks,
> >
> > Mark Scacco
> > Scacco Consulting, Inc.
> >
> >
> >
> >
>
>
Message 5 of 5
Anonymous
in reply to: Anonymous

Give this a try:

Sub SpotEl_Insert()

Dim v As Variant, d As AcadBlockReference, insPnt As Variant

insPnt = ThisDrawing.Utility.GetPoint(, "Insertion Point: ")
Set d = ThisDrawing.ModelSpace.InsertBlock(insPnt, "block_name", 1, 1, 1, 0)
v = d.GetAttributes
v(0).TextString = insPnt(2)

End Sub

block_name would have to be changed to the name of your block.
Assumption that attribute value is first attribute.

Sincerely,

Drew Burgasser
CAD Masters, Inc.


"Mark Scacco" wrote in message
news:C8D191912FB7E2E82F338DDADADD5193@in.WebX.maYIadrTaRb...
> Anyone know if I can define a block with an attribute such that the
default
> value of the attribute is the elevation at which the block itself is
> inserted? I want to insert a block at a specific elevation and have that
> elevation labeled as part of the block.
>
> Thanks,
>
> Mark Scacco
> Scacco Consulting, Inc.
>
>
>
>

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

Post to forums  

Autodesk Design & Make Report