AutoCAD Architecture Customization
Welcome to Autodesk’s AutoCAD Architecture Customization Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I access ADT/AEC objects geometry?

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

How can I access ADT/AEC objects geometry?

I have to etxract the geometry (the boundery of the shape/polyline what
ever) of my ADT areas. In the interface (ActiveX) I found properties for
Location Width and others, but I need the geometric object(s).
How can I access them? I tried wether the the ADT objects supports the Block
interface (IAcadBlock), but it does not. If there is really no way to acess
the graphic, are there some work arounds somthing like giving the object an
EED and store it in a simple drawing and reread it?

PS.
Is 'space' and 'area' the same objects? In german ît is called 'Fläche', the
objects name is 'AecDbArea', but in the ActiveX there is no such object, but
a 'AecSpace' I guess this space is an area isn't it?
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

Spaces and Areas are two separate objects in ADT3.3.

--

David Koch
Member of the Autodesk Discussion Forum Moderator Program
Message 3 of 11
Anonymous
in reply to: Anonymous

'Declare an object for your temporary use
Dim objMy as Object
'Declare a variable for your space
Dim mySpace As AecSpace
'Choose your method of accessing spaces such as
'iterating all elements of drawing, user selection by pick, etc.
'Check that entity is really an aecspace before using it.
If TypeOf objMy Is AecSpace Then
'set object to space for operations
Set mySpace = ThisDrawing.HandletoObject(objMy.Handle)
'Clear variable not in use
Set objMy = Nothing
End if
' You now have a valid aecspace what you do with it is up to you


--

Richard Binning
CADD Coordinator
The Haskell Company
http://www.thehaskellco.com


"Thomas Kohler" wrote in message
news:598377CF470925B1468AB2A2FAFECB59@in.WebX.maYIadrTaRb...
> I have to etxract the geometry (the boundery of the shape/polyline what
> ever) of my ADT areas. In the interface (ActiveX) I found properties for
> Location Width and others, but I need the geometric object(s).
> How can I access them? I tried wether the the ADT objects supports the
Block
> interface (IAcadBlock), but it does not. If there is really no way to
acess
> the graphic, are there some work arounds somthing like giving the object
an
> EED and store it in a simple drawing and reread it?
>
> PS.
> Is 'space' and 'area' the same objects? In german ît is called 'Fläche',
the
> objects name is 'AecDbArea', but in the ActiveX there is no such object,
but
> a 'AecSpace' I guess this space is an area isn't it?
>
>
Message 4 of 11
Anonymous
in reply to: Anonymous

My problem is not to get the ADT object, because I have it by iterating over
the drawing.
I should access the geometry of the area (not space like I learned). For the
area for example I should access the border Polyline/Shape or whatever a
Area is built up.
It is not a specific problem of this Area, there must be a general concept
accessing the geoumetry of AEC objects, that is not the location or a width
only, but the whole appearance like they are drawn (the geometic
promitives).
I hope I could express my problem clearer.


"Richard Binning" schrieb im Newsbeitrag
news:4B2EAA774C8BCFBD621FE177452920EB@in.WebX.maYIadrTaRb...
> 'Declare an object for your temporary use
> Dim objMy as Object
> 'Declare a variable for your space
> Dim mySpace As AecSpace
> 'Choose your method of accessing spaces such as
> 'iterating all elements of drawing, user selection by pick, etc.
> 'Check that entity is really an aecspace before using it.
> If TypeOf objMy Is AecSpace Then
> 'set object to space for operations
> Set mySpace = ThisDrawing.HandletoObject(objMy.Handle)
> 'Clear variable not in use
> Set objMy = Nothing
> End if
> ' You now have a valid aecspace what you do with it is up to you
>
>
> --
>
> Richard Binning
> CADD Coordinator
> The Haskell Company
> http://www.thehaskellco.com
>
>
> "Thomas Kohler" wrote in message
> news:598377CF470925B1468AB2A2FAFECB59@in.WebX.maYIadrTaRb...
> > I have to etxract the geometry (the boundery of the shape/polyline what
> > ever) of my ADT areas. In the interface (ActiveX) I found properties for
> > Location Width and others, but I need the geometric object(s).
> > How can I access them? I tried wether the the ADT objects supports the
> Block
> > interface (IAcadBlock), but it does not. If there is really no way to
> acess
> > the graphic, are there some work arounds somthing like giving the object
> an
> > EED and store it in a simple drawing and reread it?
> >
> > PS.
> > Is 'space' and 'area' the same objects? In german ît is called 'Fläche',
> the
> > objects name is 'AecDbArea', but in the ActiveX there is no such object,
> but
> > a 'AecSpace' I guess this space is an area isn't it?
> >
> >
>
>
Message 5 of 11
Anonymous
in reply to: Anonymous

So you are attempting to gain access to the base object entities (i.e. you
want to get the lines that make up the space in plan view).

Get ready for ObjectARX

Dean McCarns

"Thomas Kohler" wrote in message
news:3665B2927661CDC7D92904C9DA051E26@in.WebX.maYIadrTaRb...
> My problem is not to get the ADT object, because I have it by iterating
over
> the drawing.
> I should access the geometry of the area (not space like I learned). For
the
> area for example I should access the border Polyline/Shape or whatever a
> Area is built up.
> It is not a specific problem of this Area, there must be a general concept
> accessing the geoumetry of AEC objects, that is not the location or a
width
> only, but the whole appearance like they are drawn (the geometic
> promitives).
> I hope I could express my problem clearer.
>
>
> "Richard Binning" schrieb im Newsbeitrag
> news:4B2EAA774C8BCFBD621FE177452920EB@in.WebX.maYIadrTaRb...
> > 'Declare an object for your temporary use
> > Dim objMy as Object
> > 'Declare a variable for your space
> > Dim mySpace As AecSpace
> > 'Choose your method of accessing spaces such as
> > 'iterating all elements of drawing, user selection by pick, etc.
> > 'Check that entity is really an aecspace before using it.
> > If TypeOf objMy Is AecSpace Then
> > 'set object to space for operations
> > Set mySpace = ThisDrawing.HandletoObject(objMy.Handle)
> > 'Clear variable not in use
> > Set objMy = Nothing
> > End if
> > ' You now have a valid aecspace what you do with it is up to you
> >
> >
> > --
> >
> > Richard Binning
> > CADD Coordinator
> > The Haskell Company
> > http://www.thehaskellco.com
> >
> >
> > "Thomas Kohler" wrote in message
> > news:598377CF470925B1468AB2A2FAFECB59@in.WebX.maYIadrTaRb...
> > > I have to etxract the geometry (the boundery of the shape/polyline
what
> > > ever) of my ADT areas. In the interface (ActiveX) I found properties
for
> > > Location Width and others, but I need the geometric object(s).
> > > How can I access them? I tried wether the the ADT objects supports the
> > Block
> > > interface (IAcadBlock), but it does not. If there is really no way to
> > acess
> > > the graphic, are there some work arounds somthing like giving the
object
> > an
> > > EED and store it in a simple drawing and reread it?
> > >
> > > PS.
> > > Is 'space' and 'area' the same objects? In german ît is called
'Fläche',
> > the
> > > objects name is 'AecDbArea', but in the ActiveX there is no such
object,
> > but
> > > a 'AecSpace' I guess this space is an area isn't it?
> > >
> > >
> >
> >
>
>
Message 6 of 11
Anonymous
in reply to: Anonymous

Sorry I am not ready for ObjectARX, because I have no license for it.

I would like to use the ActiveX interface to iterate (windows would call it
enumerate) one AEC Object
to get the graphic primitives. If this is really not possible, then it must
have been a marketing decision,
because this functionality is available internally (the AECObjExplode
executable does exactly this job).

This brings me the idea to use an explode method to get the graphic
primitives.

Is there any such (explode) command/method I can use from ActiveX, giving
the AEC Object as input ?
I would like to get a block as result, so I could iterate the block easily
to get the graphic
primitives (using the item collection).

Thanks for any hints or ideas.
Thomas

PS.
How would ObjectARX solve my problem?

"DMC" schrieb im Newsbeitrag
news:33F4AAB39D955E5EABFB13CCE565DEA9@in.WebX.maYIadrTaRb...
> So you are attempting to gain access to the base object entities (i.e. you
> want to get the lines that make up the space in plan view).
>
> Get ready for ObjectARX
>
> Dean McCarns
>
> "Thomas Kohler" wrote in message
> news:3665B2927661CDC7D92904C9DA051E26@in.WebX.maYIadrTaRb...
> > My problem is not to get the ADT object, because I have it by iterating
> over
> > the drawing.
> > I should access the geometry of the area (not space like I learned). For
> the
> > area for example I should access the border Polyline/Shape or whatever a
> > Area is built up.
> > It is not a specific problem of this Area, there must be a general
concept
> > accessing the geoumetry of AEC objects, that is not the location or a
> width
> > only, but the whole appearance like they are drawn (the geometic
> > promitives).
> > I hope I could express my problem clearer.
> >
> >
> > "Richard Binning" schrieb im Newsbeitrag
> > news:4B2EAA774C8BCFBD621FE177452920EB@in.WebX.maYIadrTaRb...
> > > 'Declare an object for your temporary use
> > > Dim objMy as Object
> > > 'Declare a variable for your space
> > > Dim mySpace As AecSpace
> > > 'Choose your method of accessing spaces such as
> > > 'iterating all elements of drawing, user selection by pick, etc.
> > > 'Check that entity is really an aecspace before using it.
> > > If TypeOf objMy Is AecSpace Then
> > > 'set object to space for operations
> > > Set mySpace = ThisDrawing.HandletoObject(objMy.Handle)
> > > 'Clear variable not in use
> > > Set objMy = Nothing
> > > End if
> > > ' You now have a valid aecspace what you do with it is up to you
> > >
> > >
> > > --
> > >
> > > Richard Binning
> > > CADD Coordinator
> > > The Haskell Company
> > > http://www.thehaskellco.com
> > >
> > >
> > > "Thomas Kohler" wrote in message
> > > news:598377CF470925B1468AB2A2FAFECB59@in.WebX.maYIadrTaRb...
> > > > I have to etxract the geometry (the boundery of the shape/polyline
> what
> > > > ever) of my ADT areas. In the interface (ActiveX) I found properties
> for
> > > > Location Width and others, but I need the geometric object(s).
> > > > How can I access them? I tried wether the the ADT objects supports
the
> > > Block
> > > > interface (IAcadBlock), but it does not. If there is really no way
to
> > > acess
> > > > the graphic, are there some work arounds somthing like giving the
> object
> > > an
> > > > EED and store it in a simple drawing and reread it?
> > > >
> > > > PS.
> > > > Is 'space' and 'area' the same objects? In german ît is called
> 'Fläche',
> > > the
> > > > objects name is 'AecDbArea', but in the ActiveX there is no such
> object,
> > > but
> > > > a 'AecSpace' I guess this space is an area isn't it?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 7 of 11
Anonymous
in reply to: Anonymous

Thomas,

As you are discovering, ADT objects are different from standard AutoCAD
objects. The way the objects deal with graphics is a good illustration of
this difference. With a standard AutoCAD "Circle", the graphic returned are
a circle, no matter how you look at it. In the case of a door, the graphics
primitives are determined by how you are looking at the door, and what you
want the door to look like. In plan view, a simple door will be made of a
line, and an arc. In 3D, the door will be made with a body (6 faces).

In your case, you are looking for the boundary of the space or area (2
different objects, 2 different type libraries). In the current
implementation, this profile is exposed to ActiveX. However, this is on the
wish list for a future release. As suggested, with ObjectARX and the Object
Modeling Framework (OMF) this information is readly available.

Regards,
Message 8 of 11
Anonymous
in reply to: Anonymous

Thanks Peter for your clear answer!

Because I cannot wait until my whishes come true, I'm looking for a work
around.
I'm not eager for working with ObjectARX but I would do it, if there is no
other way.
What do you think about an 'Explode' work around? I guess the main problem
would be
to 'mark' the AEC Objects in a way I could find (identify) them again.

In the meantime I downloaded ObjectARX. I searched in the Help-Files,
but I could not get any idea how this could help me. Also the terms
Object Modeling Framework (OMF) I could not find there.
Can you tell me some other hints, how I should proceed ?

Reagards

Thomas

"Peter Funk - Autodesk, Inc" schrieb im
Newsbeitrag news:01B4A1F9F4D4F0DD82A55B2C0F407A6F@in.WebX.maYIadrTaRb...
> Thomas,
>
> As you are discovering, ADT objects are different from standard AutoCAD
> objects. The way the objects deal with graphics is a good illustration of
> this difference. With a standard AutoCAD "Circle", the graphic returned
are
> a circle, no matter how you look at it. In the case of a door, the
graphics
> primitives are determined by how you are looking at the door, and what you
> want the door to look like. In plan view, a simple door will be made of a
> line, and an arc. In 3D, the door will be made with a body (6 faces).
>
> In your case, you are looking for the boundary of the space or area (2
> different objects, 2 different type libraries). In the current
> implementation, this profile is exposed to ActiveX. However, this is on
the
> wish list for a future release. As suggested, with ObjectARX and the
Object
> Modeling Framework (OMF) this information is readly available.
>
> Regards,
>
>
>
>
Message 9 of 11
Anonymous
in reply to: Anonymous

Thomas,

From what I get in your post you are looking for the points of a space or
area...correct? If you grab ADTcadPac (free) there is a utility to convert
spaces to plines so you can get the points.

In development I have an OMF program that grab points of various AecObjects
and allow you to add/modify them but I have some development to finish
before I ship this.

--
Rob Starz
| president / dreamer | director
--------------------------------------------------
| Stardsign cad solutions | Autodrop , llc
| 352.263.3786 | www.autodrop.net

| AEC Designer / Consultant / Developer
| Autodesk Architectural Desktop:
Tools: www.stardsign.com
Tech Support: www.stardsign.com/support.htm
Bring the power of i-drop into AutoCAD with
i-dock(www.stardsign.com/idock.htm)


"Thomas Kohler" wrote in message
news:5F2B8F09F70E8D50C124CB7BAFB82CEA@in.WebX.maYIadrTaRb...
> Thanks Peter for your clear answer!
>
> Because I cannot wait until my whishes come true, I'm looking for a work
> around.
> I'm not eager for working with ObjectARX but I would do it, if there is no
> other way.
> What do you think about an 'Explode' work around? I guess the main problem
> would be
> to 'mark' the AEC Objects in a way I could find (identify) them again.
>
> In the meantime I downloaded ObjectARX. I searched in the Help-Files,
> but I could not get any idea how this could help me. Also the terms
> Object Modeling Framework (OMF) I could not find there.
> Can you tell me some other hints, how I should proceed ?
>
> Reagards
>
> Thomas
>
> "Peter Funk - Autodesk, Inc" schrieb im
> Newsbeitrag news:01B4A1F9F4D4F0DD82A55B2C0F407A6F@in.WebX.maYIadrTaRb...
> > Thomas,
> >
> > As you are discovering, ADT objects are different from standard AutoCAD
> > objects. The way the objects deal with graphics is a good illustration
of
> > this difference. With a standard AutoCAD "Circle", the graphic returned
> are
> > a circle, no matter how you look at it. In the case of a door, the
> graphics
> > primitives are determined by how you are looking at the door, and what
you
> > want the door to look like. In plan view, a simple door will be made of
a
> > line, and an arc. In 3D, the door will be made with a body (6 faces).
> >
> > In your case, you are looking for the boundary of the space or area (2
> > different objects, 2 different type libraries). In the current
> > implementation, this profile is exposed to ActiveX. However, this is on
> the
> > wish list for a future release. As suggested, with ObjectARX and the
> Object
> > Modeling Framework (OMF) this information is readly available.
> >
> > Regards,
> >
> >
> >
> >
>
>
Message 10 of 11
Anonymous
in reply to: Anonymous

I don't know if this helps but I get the points of the Roof Slab objects very
simply with
VBA. I just momentarily create an exact copy of the slab, then explode it. It
turns into 3d faces and some lines. Collect the points and then delete the
exploded objects
leaving me with the original slab and all the points.

Thomas Kohler wrote:

> Thanks Peter for your clear answer!
>
> Because I cannot wait until my whishes come true, I'm looking for a work
> around.
> I'm not eager for working with ObjectARX but I would do it, if there is no
> other way.
> What do you think about an 'Explode' work around? I guess the main problem
> would be
> to 'mark' the AEC Objects in a way I could find (identify) them again.
>
> In the meantime I downloaded ObjectARX. I searched in the Help-Files,
> but I could not get any idea how this could help me. Also the terms
> Object Modeling Framework (OMF) I could not find there.
> Can you tell me some other hints, how I should proceed ?
>
> Reagards
>
> Thomas
>
> "Peter Funk - Autodesk, Inc" schrieb im
> Newsbeitrag news:01B4A1F9F4D4F0DD82A55B2C0F407A6F@in.WebX.maYIadrTaRb...
> > Thomas,
> >
> > As you are discovering, ADT objects are different from standard AutoCAD
> > objects. The way the objects deal with graphics is a good illustration of
> > this difference. With a standard AutoCAD "Circle", the graphic returned
> are
> > a circle, no matter how you look at it. In the case of a door, the
> graphics
> > primitives are determined by how you are looking at the door, and what you
> > want the door to look like. In plan view, a simple door will be made of a
> > line, and an arc. In 3D, the door will be made with a body (6 faces).
> >
> > In your case, you are looking for the boundary of the space or area (2
> > different objects, 2 different type libraries). In the current
> > implementation, this profile is exposed to ActiveX. However, this is on
> the
> > wish list for a future release. As suggested, with ObjectARX and the
> Object
> > Modeling Framework (OMF) this information is readly available.
> >
> > Regards,
> >
> >
> >
> >
Message 11 of 11
Anonymous
in reply to: Anonymous

Hi Thomas,

To use an API-equivalent of AecObjExplode, even ARX would not be
sufficient - you need full OMF which is ADT-specific C++ API based on ARX.

The only workaround would be along the lines proposed by Joel. I happen to
have such VBA code that also needs some LISP commands (since no .Explode for
ADT objects) that does roughly what you need. First, the object (AecArea in
this case) is copied, then exploded twice and finally the resulting
pimitives are extracted. This should work OK for an Area like in the code
below, but you may have some problems with e.g walls due to the wall graph
connectivity and cleanup (not sure if the wall copy would clean properly).
Anyway, this is best I can suggest and it's up to you to test all individual
objects and situations. Here's the macro:

Public Sub ExtractAecAreaCurves()

' Select Area to copy
Dim ent As AcadEntity
Dim pnt As Variant
ThisDrawing.Utility.GetEntity ent, pnt, "Select AecArea"

If ent.ObjectName <> "AecDbArea" Then
MsgBox "Not an AecArea"
Exit Sub
End If

Dim cObjs(0 To 0) As Object
Set cObjs(0) = ent

Dim retObjs As Variant
retObjs = ThisDrawing.CopyObjects(cObjs)

'MsgBox "Copied ent = " & retObjs(0).ObjectName & "/" & retObjs(0).Handle

ThisDrawing.SetVariable "USERS1", retObjs(0).Handle
ThisDrawing.SendCommand "(command ""EXPLODE"" (handent(getvar
""USERS1"")))" & vbCr

' Exploded Result must be only one BlkRef
If ThisDrawing.ActiveSelectionSet.Count <> 1 Then
'... delete ents and some msg.
Exit Sub
Else
If ThisDrawing.ActiveSelectionSet(0).ObjectName <> "AcDbBlockReference"
Then
'... delete it and some msg.
Exit Sub
Else
Set ent = ThisDrawing.ActiveSelectionSet(0)
End If
End If

'MsgBox "First-Exploded ent = " & ent.ObjectName & "/" & ent.Handle

ThisDrawing.SetVariable "USERS1", ent.Handle
ThisDrawing.SendCommand "(command ""EXPLODE"" (handent(getvar
""USERS1"")))" & vbCr

For Each ent In ThisDrawing.ActiveSelectionSet
MsgBox "Second-Exploded ents = " & ent.ObjectName & "/" & ent.Handle
If ent.ObjectName = "AcDbLine" Then
' get data from this line...
ElseIf ent.ObjectName = "AcDbArc" Then
' get data from this arc...
End If
ent.Delete
Next

End Sub



Hope this helps.

--
Cheers,

Miro

========================
Miroslav Schonauer
Developer Technical Services
Autodesk
========================


"Joel Houtman" wrote in message
news:3DA321F0.4200D16@earthlink.net...
> I don't know if this helps but I get the points of the Roof Slab objects
very
> simply with
> VBA. I just momentarily create an exact copy of the slab, then explode it.
It
> turns into 3d faces and some lines. Collect the points and then delete the
> exploded objects
> leaving me with the original slab and all the points.
>
> Thomas Kohler wrote:
>
> > Thanks Peter for your clear answer!
> >
> > Because I cannot wait until my whishes come true, I'm looking for a work
> > around.
> > I'm not eager for working with ObjectARX but I would do it, if there is
no
> > other way.
> > What do you think about an 'Explode' work around? I guess the main
problem
> > would be
> > to 'mark' the AEC Objects in a way I could find (identify) them again.
> >
> > In the meantime I downloaded ObjectARX. I searched in the Help-Files,
> > but I could not get any idea how this could help me. Also the terms
> > Object Modeling Framework (OMF) I could not find there.
> > Can you tell me some other hints, how I should proceed ?
> >
> > Reagards
> >
> > Thomas
> >
> > "Peter Funk - Autodesk, Inc" schrieb im
> > Newsbeitrag news:01B4A1F9F4D4F0DD82A55B2C0F407A6F@in.WebX.maYIadrTaRb...
> > > Thomas,
> > >
> > > As you are discovering, ADT objects are different from standard
AutoCAD
> > > objects. The way the objects deal with graphics is a good illustration
of
> > > this difference. With a standard AutoCAD "Circle", the graphic
returned
> > are
> > > a circle, no matter how you look at it. In the case of a door, the
> > graphics
> > > primitives are determined by how you are looking at the door, and what
you
> > > want the door to look like. In plan view, a simple door will be made
of a
> > > line, and an arc. In 3D, the door will be made with a body (6 faces).
> > >
> > > In your case, you are looking for the boundary of the space or area (2
> > > different objects, 2 different type libraries). In the current
> > > implementation, this profile is exposed to ActiveX. However, this is
on
> > the
> > > wish list for a future release. As suggested, with ObjectARX and the
> > Object
> > > Modeling Framework (OMF) this information is readly available.
> > >
> > > Regards,
> > >
> > >
> > >
> > >
>

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

Post to forums  

Autodesk Design & Make Report

”Boost