please help with creating custom objects/classes

please help with creating custom objects/classes

Anonymous
Not applicable
182 Views
1 Reply
Message 1 of 2

please help with creating custom objects/classes

Anonymous
Not applicable
hi.

i am doing some vba development in acad 2000, and ran into some problems creating a desired class, i.e a selectionset object, derived from acdbobject that can contain selection sets. i decided to try creating this using the arx wizard, then loading this into vba. i created a skeletal arx, without modification, then created a (new) dbx within the arx project. there is a dbx dll and arx dll in sepparate debug folders, and i have loaded them 1 by 1 using the appload dialog. i cant get it to work, as the vba is not recognizing the class name when i try to declare /instantiate the object in vba. also, in the class definition as i have it, i could not figure out how to define an AcArray as one of my member objects, as there was no such option in the variable list. below is the outline of the objects (properties and methods) i am trying to create (this is NOT from the arx). please help anyone.

typedef AcArray elements;
class sarsetlist:public acdbobject
{
private:
elements items

public:
char name[100];
sarsetcollection();
~sarsetcollection();
//2 implementations of item for integer and string
acdbentity item(int);
acdbentity item(char*);
virtual int count();
virtual void setname(char*);
virtual void delete(acdbobj);
virtual void remove(acdbobj);
virtual acdbobject additems();
}

class sarsetcollections:public acdbobject
{
private:
elements items
public:
char name[100];
sarsetcollection();
~sarsetcollection();
//2 implementations of item for integer and string
acdbentity item(int);
acdbentity item(char*);
virtual int count();
virtual void setname(char*);
virtual void setname(char[]);
virtual void remove(acdbobj);
}
0 Likes
183 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
To expose an ARX function to VBA you have to write
a COM wrapper using ATL. Its not enough to simply load the ARX module. Take a
look in the ObjectARX Developer's Guide - there's a whole chapter on COM and
ATL.


Cheers,

 

Stephen Preston
Developer Technical
Services
Autodesk


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
hi.

am doing some vba development in acad 2000, and ran into some problems
creating a desired class, i.e a selectionset object, derived from acdbobject
that can contain selection sets. i decided to try creating this using the arx
wizard, then loading this into vba. i created a skeletal arx, without
modification, then created a (new) dbx within the arx project. there is a dbx
dll and arx dll in sepparate debug folders, and i have loaded them 1 by 1
using the appload dialog. i cant get it to work, as the vba is not recognizing
the class name when i try to declare /instantiate the object in vba. also, in
the class definition as i have it, i could not figure out how to define an
AcArray as one of my member objects, as there was no such option in the
variable list. below is the outline of the objects (properties and methods) i
am trying to create (this is NOT from the arx). please help anyone.

typedef AcArray<acdbentity> elements;
class sarsetlist:public
acdbobject
    {
private:
elements items

public:
char name[100];
sarsetcollection();

~sarsetcollection();
//2 implementations of item for integer and
string
acdbentity item(int);
acdbentity item(char*);
virtual int
count();
virtual void setname(char*);
virtual void delete(acdbobj);

virtual void remove(acdbobj);
virtual acdbobject additems();

    }

class sarsetcollections:public acdbobject
    {

private:
elements items
public:
char name[100];

sarsetcollection();
~sarsetcollection();
//2 implementations of
item for integer and string
acdbentity item(int);
acdbentity
item(char*);
virtual int count();
virtual void setname(char*);

virtual void setname(char[]);
virtual void remove(acdbobj);

    }

0 Likes