Author Topic: My first custom object  (Read 6165 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
My first custom object
« on: May 02, 2009, 11:17:21 AM »
Whoopee  :roll:


Spike Wilbury

  • Guest
Re: My first custom object
« Reply #1 on: May 02, 2009, 11:22:41 AM »
:)

What it does?

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #2 on: May 02, 2009, 11:41:32 AM »
try it  :laugh:

Spike Wilbury

  • Guest
Re: My first custom object
« Reply #3 on: May 02, 2009, 11:57:53 AM »
try it  :laugh:

I see and not bad :)


The first time I tried - I open AutoCAD 2009 and load the DBX, then I open the Drawing1.dwg and did not display anything, until I changed the name, but later I tried again and it was displaying on your original Drawing1.dwg

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #4 on: May 02, 2009, 12:09:45 PM »
Thanks, I guess I should have named the drawing.

It took me a little while to figure out how to manipulate the grips, all the samples show using

virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);

I had to override and return Acad::eNotImplemented on this function

virtual Acad::ErrorStatus moveGripPointsAt( const AcDbVoidPtrArray& gripAppData,const AcGeVector3d& offset, const int bitflags);

to get my grips to work using the older method

Spike Wilbury

  • Guest
Re: My first custom object
« Reply #5 on: May 02, 2009, 12:35:17 PM »
Thanks, I guess I should have named the drawing.

It took me a little while to figure out how to manipulate the grips, all the samples show using

virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);

I had to override and return Acad::eNotImplemented on this function

virtual Acad::ErrorStatus moveGripPointsAt( const AcDbVoidPtrArray& gripAppData,const AcGeVector3d& offset, const int bitflags);

to get my grips to work using the older method

Is your custom object derived from AcDbPolyline ?

If it is, you can use:

Code: [Select]
Acad::ErrorStatus XXXXXXXXX::moveGripPointsAt (
const AcDbVoidPtrArray &gripAppData, const AcGeVector3d &offset,
const int bitflags
) {
assertWriteEnabled () ;

//----- If you return eNotImplemented here, that will force AutoCAD to call
//----- the older getGripPoints() implementation. The call below may return
//----- eNotImplemented depending of your base class.
return ([color=red]AcDbCurve[/color]::moveGripPointsAt (gripAppData, offset, bitflags)) ;
}

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #6 on: May 03, 2009, 12:59:13 AM »
Hey LE,

Have you seen any examples using the new method? I wasnít sure how to keep track of the index, also it might be cool to mess around with the glyphs, (little happy faces or something )

ahlzl

  • Guest
Re: My first custom object
« Reply #7 on: May 03, 2009, 07:02:48 AM »
Daniel , can you share code?

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #8 on: May 04, 2009, 11:00:16 AM »
Daniel , can you share code?

Here is the source for the custom object, itís not done yet.
The finished version is going to have special constructors and stuff for the app its going into.


It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #9 on: May 06, 2009, 10:22:37 AM »
And with the change of a couple of paths


Spike Wilbury

  • Guest
Re: My first custom object
« Reply #10 on: May 06, 2009, 11:29:02 AM »
you are da' man Danielito....  :-P

(didn't know they have also custom objects.... good)

MP

  • Seagull
  • Posts: 17446
Re: My first custom object
« Reply #11 on: May 06, 2009, 11:31:40 AM »
And with the change of a couple of paths ...

Noice! :D
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

ahlzl

  • Guest
Re: My first custom object
« Reply #12 on: May 07, 2009, 09:52:00 AM »
success !

thanks Daniel again.

Spike Wilbury

  • Guest
Re: My first custom object
« Reply #13 on: May 25, 2009, 01:15:06 PM »
Hi Daniel,

Don't know if you have noticed this.

Since your custom entity derived from an AcDbPolyline, it can be modified the rectangle form, for example when it is called PEDIT, and lost also the designed grips (for example if you use PEDIT - FIT - DECURVE).

I know this is for your personal use, just want it to comment about it.

Have fun.

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6941
  • AKA Daniel
Re: My first custom object
« Reply #14 on: May 26, 2009, 05:43:50 AM »
Interesting! Is there a way I can protect my entity from such malicious attacks?