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

HELP Grabbing Aeccpoints

29 REPLIES 29
Reply
Message 1 of 30
Anonymous
464 Views, 29 Replies

HELP Grabbing Aeccpoints

How can I capture the AeccPoint from VB6? The following sample code shows more clearly what I need.

When I run it (actually, the production version of it) It picks up the ACAD points, AcadBLock, and AcadLWPolyline, but it doesn't capture any of the Aecc stuff. Can someone help me with how to do this?
********************************************************************
Sample Code:

Dim selItem as Object
Dim SelGroup as object
Dim MyPoint as AcadPoint



For each selItem in SelGroup
If TypeOf selItem Is AcadLWPolyline then
Debug.pring Type: LwPolyline

ElseIf TypeOf selItem is AcadPoint then
Set MyPoint = selitem
Debug.print Northing & myPoint.Northing
Debug.print Easting & myPoint.Easting
Debug.print Elevation & myPoint.Elevation

ElseIf TypeOf selItem is AcadBlockReference then
Debug.print Easting:  & selItem.InsertionPoint(0)
Debug.print Northing:  & selitem.Insertionpoint(1)
Debug.print Altitude:  & selitem.InsertionPoint(2)

ElseIf TypeOf selItem is AeccPoint then
Debug.print Easting:  & selItem.InsertionPoint(0)
Debug.print Northing:  & selitem.Insertionpoint(1)
Debug.print Altitude:  & selitem.InsertionPoint(2)

End If
Next SelItem
29 REPLIES 29
Message 21 of 30
Anonymous
in reply to: Anonymous

OK now we're getting bizarre. I tried it all again, put on some counters to count the items, and I'm getting 34 acad points, 0 aeccpoints, and 194 items examined total. The execution just doesnt see the aeccpoints on

If TypeOf ent Is AeccPoint Then.....

For project references, I have Autodesk Land 4.0 type library. I also had AEC Base and AEC Objects for a while, but they didn't help.

Are there any other references, etc I might be missing?
Is there another machine there you can try it on?

thanks,
mark c.
Message 22 of 30
Anonymous
in reply to: Anonymous

FWIW, I just tried a small test drawing with Peter's code in LDD3 with the Land 1.2 reference and it worked just fine. -- Jeff check out www.cadvault.com "markc01" wrote in message news:29697948.1109110837126.JavaMail.jive@jiveforum1.autodesk.com... > OK now we're getting bizarre. I tried it all again, put on some counters > to count the items, and I'm getting 34 acad points, 0 aeccpoints, and 194 > items examined total. The execution just doesnt see the aeccpoints on > > If TypeOf ent Is AeccPoint Then..... > > For project references, I have Autodesk Land 4.0 type library. I also had > AEC Base and AEC Objects for a while, but they didn't help. > > Are there any other references, etc I might be missing? > Is there another machine there you can try it on? > > thanks, > mark c.
Message 23 of 30
Anonymous
in reply to: Anonymous

Thanks Jeff, I need all the help I can get on this one. But for some reason it just won't work for me. I'm about ready to start posging screen shots.

What did you have for project references?
Message 24 of 30
Anonymous
in reply to: Anonymous

Here's a screenshot showing what I used and the result. Remember, I'm using LDD3, but the principle is the same. HTH, -- Jeff check out www.cadvault.com "markc01" wrote in message news:9081945.1109115314332.JavaMail.jive@jiveforum1.autodesk.com... > Thanks Jeff, I need all the help I can get on this one. But for some reason it just won't work for me. I'm about ready to start posging screen shots. > > What did you have for project references?
Message 25 of 30
Anonymous
in reply to: Anonymous

Blocks that look like points... I'm not sure if that's a problem, it shouldn't be.

HOWEVER I tried the Qselect, and guess what - it reports 30 Aeccpoints, not 3. So I did a zoom extents, and then zoomed into another small group of points at the bottom, finding a whole bunch of Aeccpoints. So the code should be finding 30 points, right?

Nevertheless, I can't even find the 3, and I can't imagine what I'm doing wrong. Are there any other settings I might have screwed up? Is there some special support level I can use to get this resolved?

thanks,
mark c.
Message 26 of 30
Anonymous
in reply to: Anonymous

Mark, I tried you code again and again it worked. Last time I deleted the group of points off in space (I thought that I put them in by mistake). This time I modified your code to include a little counter, and it returned 30 and 34, exactly the same as I found with qselect. I ran your code as is, and your references are correct. I've also modified the code to print out the object type if it's not a AeccPoint or an AutoCAD Point. You are running LDT when you try to do this, correct? To test this, add a point with the LDT menu before you run the routine. There is nothing wrong with the code. I'm the API Product Manager for ISD (Civil Products) so there is no one better to answer this question Regards, Peter Funk Autodesk, Inc. Private Sub CommandButton1_Click() Dim ent As AcadEntity Dim i As Integer Dim j As Integer i = 0 j = 0 For Each ent In ThisDrawing.ModelSpace If TypeOf ent Is AeccPoint Then Dim AeccPt As AeccPoint Set AeccPt = ent Debug.Print "aeccPt: " & AeccPt.Northing; AeccPt.Easting; AeccPt.Elevation i = i + 1 ElseIf TypeOf ent Is AcadPoint Then Dim aPoint As AcadPoint Set aPoint = ent Debug.Print "AcadPoint:" & aPoint.Coordinates(0); aPoint.Coordinates(1); aPoint.Coordinates(2) j = j + 1 Else Debug.Print ent.ObjectName End If Next MsgBox i & " " & j End Sub
Message 27 of 30
Anonymous
in reply to: Anonymous

Peter - I'm almost there. I started looking for something beyond the code that was failing, and began examining and trying some of the project settings. I think since I didn't have all my clients project files, I was canceling thru some of the error messages on drawing startup. But I decided to work with that and somehow got some of the project settings right - and it started working perfectly.

So I closed everything out and went back in, trying to find what it was that effected the change. And I'm back to the beginning for the moment.

So there's something in the project setup that affects the vba module or object model, and I'm looking to isolate that. As I recall, I sent you the drawing only...how did you set it up?

almost there,
mark c.
Message 28 of 30
Anonymous
in reply to: Anonymous

I just added the file to a junk project and was on my way. Peter Funk Autodesk, Inc.
Message 29 of 30
Anonymous
in reply to: Anonymous

As I said, I'm making progress. However I'm stuck on this:

when building a selection set filter, you have to set the filter type and the filter data. based on other parts of this thread,

filterType = GroupCode = 0 (entitty type)
this seems to work for the things I need

FilterData = a dxf string for the object:
"POINT"

"AECC_POINT" for our infamous aeccpoints

I also need the filter data for
LIghtWeight polylines"

Block reference (i.e. blocks inserted into the drawing)

I've searchded all the Help/dxf reference material and can't seem to find the info.

Can you help me with these missing items?

thanks,
mark c.
Phoenix
It finally stopped raining!
Message 30 of 30
Anonymous
in reply to: Anonymous

Mark, I think those are "LWPOLYLINE" and "INSERT" Peter Funk Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report