Author Topic: Using Overrules for simulating custom objects  (Read 2401 times)

0 Members and 1 Guest are viewing this topic.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Using Overrules for simulating custom objects
« on: February 19, 2014, 03:59:12 AM »
I see a lot of examples of using Overrules that show objects in a different way. Like circles instead of lines, or centerlines in a circle. But is it also possible to use this technique to create custom objects with new properties? Like using a polyline which act like a pipeline and if you list it or view the Properties, you see it is a Pipeline with new properties?

Or can Overrules only be used to alter the visible parts of objects?
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Using Overrules for simulating custom objects
« Reply #1 on: February 19, 2014, 11:51:54 AM »
A simple search of the object browser in visual studio shows that there is a PropertiesOverrule.  Not sure how this behaves however.   
 
Couldn't you inherit from the entity that you want and add the properties to that entity and just overrule the geometry of the entity.  Then you could display all of the properties of your inherited entity anyway that you want.  It is possible that the entity you want does not support inheritance.  I know that some AutoCAD MEP members are that way.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

DavidS

  • Mosquito
  • Posts: 15
Re: Using Overrules for simulating custom objects
« Reply #2 on: February 19, 2014, 03:13:37 PM »
I have inserted a link below where Stephen Preston talks about Overrules.  Jump to time frames 5:50 and 23:40 for PropertiesOverrule.

CP9310-1 - Customizing Entity Behavior in AutoCADŽ .NET
http://autodesk.mediasite.com/Mediasite/Play/82851c5d50c9436db812a87fc5900085

DavidS.
« Last Edit: February 19, 2014, 03:33:15 PM by DavidS »

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Using Overrules for simulating custom objects
« Reply #3 on: February 20, 2014, 02:39:30 AM »
Thank you DavidS, that is really informative!

So basically it is possible to create kind of custom entities. But it is a shortcoming that there are no proxy objects created. So you need to load the dll else you would not know that the entities supposed to be objects.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

DavidS

  • Mosquito
  • Posts: 15
Re: Using Overrules for simulating custom objects
« Reply #4 on: February 20, 2014, 09:59:41 AM »
Huiz,

Yes that is the way that I see Overrules as well, but I have not actually used them.  I've only watched the video, and I've not thought of anything that I would need this for.

On a side note, while I appreciate your thanks, I am just the messenger.  Here is the link to Stephen's post if you want to thank him or get more information:
http://adndevblog.typepad.com/autocad/2013/05/api-webcast-archive.html

DavidS

bargool

  • Guest
Re: Using Overrules for simulating custom objects
« Reply #5 on: February 20, 2014, 12:18:34 PM »
So basically it is possible to create kind of custom entities. But it is a shortcoming that there are no proxy objects created. So you need to load the dll else you would not know that the entities supposed to be objects.
Maybe use anonymous blocks as non-editable (without your application) custom entities?

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Using Overrules for simulating custom objects
« Reply #6 on: February 20, 2014, 01:34:41 PM »
Huiz,

Yes that is the way that I see Overrules as well, but I have not actually used them.  I've only watched the video, and I've not thought of anything that I would need this for.

On a side note, while I appreciate your thanks, I am just the messenger.  Here is the link to Stephen's post if you want to thank him or get more information:
http://adndevblog.typepad.com/autocad/2013/05/api-webcast-archive.html

DavidS


Preston didn't point me to his webcast so I thank you :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Using Overrules for simulating custom objects
« Reply #7 on: February 20, 2014, 01:40:50 PM »
..
Maybe use anonymous blocks as non-editable (without your application) custom entities?

There are some work arounds but it takes some effort. If I see Preston's webcast then it is possible to draw a line and present that simple line like a thermometer with grips to alter the heat. That is one example. The values kan be stored in the extension database or xdata. The visibility is done by the dll. So if someone does not have the dll, they only see a simple line.

What we can do is create a screen wide text saying there are custom objects in the drawing. The text is invisible if the dll is loaded.

Another solution is indeed using (anonimous) blocks which have the duplicate objects of the custom objects and are invisible if the dll is loaded. If the dll is not loaded, the custom object is not visible but the block is. Maybe... that could be the solution :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.