The basic problem(s) you're having is that you are trying to
do AutoCAD programming without first having to learned the
basics of programming. Like for example, how to work with
arrays. It doesn't matter what langauge you're using because
the most basic concepts that you're missing are not language-
specific, they just vary slighly in how they work.
Instead of Dim objEnts() As AcadEntity, use a List Of(AcadEntity)
(look up the List Of() class in the docs). To use that class you
must use 'Imports System.Collections.Generic' if you don't already
have it.
The List Of() class allows you to construct a list of objects by
adding one at a time, without having 'empty' or null elements,
which is why it isn't accepting what you give it. You don't have
to give it the size when you create it, just call the Add() method
each time you add another element. Look for examples of using
it, don't ask me to show you how.
After you create the list of the objects, you can use the ToArray()
method to convert them to an array that you can pass to the
RemoveObjects() method.
In the mean time, unless someone here wants to tutor you on
programming 101, I strongly suggest you stop trying to run,
and spend some time learning to crawl and walk first.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
wrote in message news:5911373@discussion.autodesk.com...
Good morning Tony,
(OK...I'm sitting here trying to think of how/what to write so I'll do this correctly...)
I have been looking for 3 days now (it seems like forever)...
You mention in your post below that you've been successful in "just about everything AcadX did using the AutoCAD .NET API"...I need some direction please...
I seem to be having trouble using the RemoveItems method with my selection sets.
Here's my code...
Dim intI As Integer
Dim objEnts() As AcadEntity
ReDim objEnts(oSS3.Count - 1)
intI = 0
If oSS3.Count > 0 Then
For Each oEntity In oSS3
If TypeOf oEntity Is AcadDimRotated Then
MsgBox("We have an AcadRotDimension...intI = " & intI)
objEnts(intI) = oEntity
intI = intI + 1
End If
Next oEntity
End If
MsgBox("Ready to remove objects.") ' <- THIS EXECUTES
oSS3.RemoveItems(objEnts) ' <- THIS FAILS
Any help appreciated! Thanks!