Author Topic: Custom Object - Pros and Cons  (Read 5719 times)

0 Members and 1 Guest are viewing this topic.

Draftek

  • Water Moccasin
  • Posts: 1501
Custom Object - Pros and Cons
« on: May 11, 2006, 11:29:44 AM »
I've been playing with building a few custom objects over the years but have not had the guts to actually deploy one to my customers.

My current project is a schedule created in autocad based off of an xml databse on our web site that builds a table object. The users can explode this and screw up the xdata smarts and hose it.

I'm playing with creating a simple object derived from the table object. Removing the user's ability to modify the schedule (without my interface) or explode it. Then using a managed wrapper so I can create my interface in c#.

Any of you guys have any advice on deploying (or not) a custom object? I have about 1,000 current users of some autocad add-ins I've created. I update this each year and could include this new object at that time.

Thanks
Soli Deo Gloria

Chuck Gabriel

  • Guest
Re: Custom Object - Pros and Cons
« Reply #1 on: May 11, 2006, 11:50:17 AM »
I really shouldn't comment, because I've never had the guts to deploy one either.  However ...

Depending on what versions of AutoCAD your users are running, you could end up having to maintain multiple versions of your object.  I realize this problem isn't isolated to custom objects or even ObjectARX, but at least with other types of AutoCAD customization you don't have to maintain multiple development environments.

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #2 on: May 11, 2006, 12:14:49 PM »
yeah, good point. I'm starting with 2007.

Autodesk should pay me to force 1,000 people to upgrade....
Soli Deo Gloria

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16723
  • Superior Stupidity at its best
Re: Custom Object - Pros and Cons
« Reply #3 on: May 11, 2006, 12:37:07 PM »
I have never deployed a custom object, mainly because while it would work great in a close environment, in the event your custom object is needed to be viewed by a client (or client of a client) you would either need to have a viewer for them (or they get the  dreaded proxy object) or allow it to be deployed to multiple users outside of your control. Of course this would happen even if the drawings had the object in them, but the client did not need to see it. I know I hate to get drawings with proxy objects becasue I don't know what isn't there .. thus I am afraid my drawings may not be an accurate representation of them.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #4 on: May 11, 2006, 01:23:11 PM »
More good points.

In this case, I'm planning on providing the enabler (the dbx, along with the interface for that matter) on our web site just in case anyone needs it. Although, as long as they have show proxy objects set to on, they have all the functionality someone with the enabler would have. I only want manipulation done thru the interface to insure the table is correct.

The client is actually my company in this case, with only some print review done by others.

One of the purposes of doing it this way is to keep our competitors from using my programs, which has happned in the past with some activex stuff.
Soli Deo Gloria

MickD

  • Gator
  • Posts: 3312
  • (x-in)->[process]->(y-out)
Re: Custom Object - Pros and Cons
« Reply #5 on: May 11, 2006, 06:32:10 PM »
Custom objects in principle are a great idea, in practice however they can be a real burden to both the developer and the end user. As Keith pointed out there is the proxy object thing, then there's the COM interface if you want your object to appear correctly in the properties box. You should also provide a converter to std acad objects routine (usually done for 'explode').

In your situation with many users and a company willing to pay for the development and maintenance it may be the way to go if you can not see any other way around it.

hth.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #6 on: May 12, 2006, 07:59:08 AM »
Thanks.

In this case, I think the custom object is the way to go. I will do some testing on the properties box but so far it seems to be displaying the standard table stuff, which is what I want. The explode is what I don't want done.

It's weird, one of the reasons I wanted to do this was to make myself use more c++, but with the manageed wrapper, there is very little c++ needed and most of that was created by the objectarx wizard...

And, if I change my mind later, it will be very easy to use a standard table because all of the manipulation done to the managed wrapper are identical to working with a standard table object.

Thanks again.

Soli Deo Gloria

Chuck Gabriel

  • Guest
Re: Custom Object - Pros and Cons
« Reply #7 on: May 12, 2006, 08:48:21 AM »
If you could still convince yourself it is the right thing to do after all that negative press, you must have a pretty strong case. :D

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16723
  • Superior Stupidity at its best
Re: Custom Object - Pros and Cons
« Reply #8 on: May 12, 2006, 08:53:45 AM »
Please understand that my "negative press" is limited to an environment where the drawings would be used in an outside organization. In a deployment where the developer has a close environment (even if that environment is over 1000 computers), that deployment would be a good if the custom object resolves the issues with the users.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #9 on: May 12, 2006, 09:11:16 AM »
heh. I'm usually my own worst enemy..

Soli Deo Gloria

MickD

  • Gator
  • Posts: 3312
  • (x-in)->[process]->(y-out)
Re: Custom Object - Pros and Cons
« Reply #10 on: May 12, 2006, 07:32:59 PM »
Please understand that my "negative press" is limited to an environment where the drawings would be used in an outside organization. In a deployment where the developer has a close environment (even if that environment is over 1000 computers), that deployment would be a good if the custom object resolves the issues with the users.

ditto ^

The main reason I don't like custom objects it that when you're the end user and they don't behave it can be very frustrating. If you have the source code though these problems can be fixed as needed and you don't need to wait for a patch or pay for so called 'upgrades'.

If you think about it long enough you will find a way to get by with standard acad objects, in your case where you don't want the user to explode the table you could handle that with a reactor. You would most likely have to do this anyway as there is no real easy way to stop them exploding custom objects.

What I do these days is write wrapper classes for std acad objects that provide an interface for what I need and not others. You can do this by deriving straight from an acad object or by passing a pointer to the object in the constructor (this is what I usually do),  just don't register it as a custom class.

This enables the end user to work with tried and tested standard autocad objects and keeps your files integrity intact at all times.
hth.
Mick.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #11 on: May 15, 2006, 09:01:29 AM »
hmm. I will think about it long and hard before deploying outside the company if I go with the custom object.

Couple of things - I don't understand your comment about overriding explode being difficult. All I had to do was override the function and return code.

How are you storing persistant data with your wrapper class object? xdata? xrecords?

Thanks
Soli Deo Gloria

MickD

  • Gator
  • Posts: 3312
  • (x-in)->[process]->(y-out)
Re: Custom Object - Pros and Cons
« Reply #12 on: May 15, 2006, 06:51:22 PM »
Couple of things - I don't understand your comment about overriding explode being difficult. All I had to do was override the function and return code.

of course, it's been a while since I've played with CE's...:)

How are you storing persistant data with your wrapper class object? xdata? xrecords?

Thanks

Yes I use both, xdata for points or directions that require updating when the object is xformed and xrec's for all other data.
At the end of the day, your stored data is just an address in memory as is a class variable/member albeit a bit further away (perhaps) so  I think performance is not really an issue if you can organise your xrec's data with that in mind.

Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #13 on: May 16, 2006, 07:45:16 AM »
Thanks, Mick.

Helpful info to make a decision.
I have about 150 in house users I can test on before I unleash the final project in October.

I'll let you know which way and how it goes...
Soli Deo Gloria

MickD

  • Gator
  • Posts: 3312
  • (x-in)->[process]->(y-out)
Re: Custom Object - Pros and Cons
« Reply #14 on: May 16, 2006, 06:00:22 PM »
Best of luck, and just holler if I can help in any way, I still like working with them as they teach you a great deal about how AutoCAD works at its heart.
Cheers,
Mick.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #15 on: May 17, 2006, 07:43:04 AM »
Okay, Thanks.

I SO want to do more C++ but the managed classes are SO much easiser to work with...
Soli Deo Gloria

DaveW

  • Guest
Re: Custom Object - Pros and Cons
« Reply #16 on: June 19, 2006, 09:43:44 AM »
Quite a few companies in my industry, woodworking, have used custom objects.

One, 2020, went as far to provide on an OEM version of ACAD with their custom objects. They have begun to see that their end users are very limited without access to other third party addons. Now they are offering both, or in the very near future. Another company, Microvellum, is now going to offer an OEM too. I guess they have not learned that lesson yet.

From what I have seen, I would agree with Mick 100%. If you make a custom object, you must not only provide the enabler, but a way for someone to export that object out as the highest level entity as possible. Example: If you object appears as a 3D solid, do not export out a bunch of faces and give your customer a mess. They had one object before, so give them one object now.

I would never force a company to upgrade to newer version of ACAD, unless the version is more than 4 years old. It is just too expensive for them in the end. I have been very unhappy with some precision stuff in 2007. It is still pretty new and I am hearing about new (big) bugs almost every day. You are going to have to weigh the pros and cons of supporting a few ACAD versions vs. finding another creative workaround that protects the data. Good luck.

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #17 on: June 19, 2006, 10:18:51 AM »
Thanks Dave.

I appreciate your time and advice. I've been thinking of this quite a bit.

I'm starting with a relatively simple custom object and with the new mixed / managed mixing I think I can create something that works like a custom object when my program is loaded and works as a standard autocad object(s) when not.

Still have a lot of proto-typing to do yet.
Soli Deo Gloria

MickD

  • Gator
  • Posts: 3312
  • (x-in)->[process]->(y-out)
Re: Custom Object - Pros and Cons
« Reply #18 on: June 19, 2006, 06:12:03 PM »
...
I'm starting with a relatively simple custom object and with the new mixed / managed mixing I think I can create something that works like a custom object when my program is loaded and works as a standard autocad object(s) when not.
...

Here's a piccy of one of my classes that does pretty much what you say, I pass in a standard object (ref Solid3d) add some data and functionality to it and you have a 'custom' like object which is still a standard object at the end of the day.
Another way may be to subclass your acad object, I think I started that way but for some reason I went this way...???
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Custom Object - Pros and Cons
« Reply #19 on: June 20, 2006, 08:07:06 AM »
Thanks Mick,

Lots to digest.

I have to finish my current app, get it deployed in-house with 2007 and then I'll start diagraming and proto-typing.

I'm sure I will be asking tons of questions...
Soli Deo Gloria