.NET

Reply
Member
darpz
Posts: 4
Registered: ‎02-26-2012
Message 1 of 11 (327 Views)

Entity advice

327 Views, 10 Replies
02-26-2012 09:44 AM

Hi, i'm starting to develop a .NET plugin, so i'd like to have some advice from you experts :smileywink:

I've just to draw some rectangles on a map (a 2D layer) an then set a label that show me the name and then set other "invisible" properties that describe my area.

 

I thought to represent this with a region and put a label on it; I'd like that these entities have a kind of relation, like move togheter etc. and finally store into this area some properties, like strings and numbers.

 

i have to create a custom entity with C++ or there is some other (easier) way to do this?

 

thanks in advance....

 

Bye.

 

 

 

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 2 of 11 (296 Views)

Re: Entity advice

02-27-2012 05:44 AM in reply to: darpz

hi

 

database services contain a GROUP dbobject, which can take the respective label as name and any entities you want associated with it can be appended (and removed), although they remain individually editable.

 

felix

Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 3 of 11 (269 Views)

Re: Entity advice

02-28-2012 01:52 PM in reply to: FFlix

I don't think you have to use C++, you could use any .NET language. 

 

Visual Basic, C++, C# and there's some others. 

 

But if you are learning why not try Visual basic. 

 

Have fun, the adventure has only begun

 :smileyhappy:

Valued Mentor
KerryBrown
Posts: 278
Registered: ‎11-29-2008
Message 4 of 11 (264 Views)

Re: Entity advice

02-28-2012 03:09 PM in reply to: VB_Autocad_guy

VB_Autocad_guy

>> I don't think you have to use C++, you could use any .NET language.

 

If the op wants custom objects c++ ARX is the option.

.NET managed does NOT create custom objects.

 

Regards



 



//-------------------------------------------------------

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

*Expert Elite*
dgorsman
Posts: 5,698
Registered: ‎10-12-2006
Message 5 of 11 (255 Views)

Re: Entity advice

02-28-2012 03:27 PM in reply to: KerryBrown

C++ *is* the only way for custom objects, but there may be some other options that are easier to implement and friendlier to other users: static or dynamic (stretchable) block with attributes, grouped entities, either with XDATA or Extension Dictionaries/XRecords both come to mind.

 

As I always say, code is the end product, not the start.  There needs to be a lot of prior planning, outlines, object model research, etc. prior to writing a single line of code.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Valued Mentor
KerryBrown
Posts: 278
Registered: ‎11-29-2008
Message 6 of 11 (251 Views)

Re: Entity advice

02-28-2012 04:20 PM in reply to: dgorsman

:smileyhappy:

true that !

//-------------------------------------------------------

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 7 of 11 (241 Views)

Re: Entity advice

02-28-2012 08:14 PM in reply to: KerryBrown

Thanks Kerry,

 

Custom Objects huh? So you can do that in Arx huh?

Thanks for clarification.

Member
darpz
Posts: 4
Registered: ‎02-26-2012
Message 8 of 11 (230 Views)

Re: Entity advice

02-29-2012 02:28 AM in reply to: darpz

Thanks guys, i think i will wait a white before try to create c++ custom object.

The "Group of Entities" solution seems to be a good choice!

So i will try to put a region and a label with the name in a group, i have just another question:

Where can i put the other properties of my object, i'd like to have a group with its (invisible)

data field like a C# class; I read i can use XData, correct?

There's a tutorial that explain how to use it?

 

Thanks again

Cheers.

 

dp

 

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 9 of 11 (222 Views)

Re: Entity advice

02-29-2012 04:50 AM in reply to: darpz

the way to create "custom objects" in .NET is the Overrule API

 

XData is an easy way to stick some data to entities, but it has limitations (i think there's a maximum size of the XData), it's recomended to use ExtensionDictionary, which is also quite simple

 

you have to create the ExtensionDicionary with DBObject.CreateExtensionDicionary() and then add some Xrecords in it

Valued Mentor
KerryBrown
Posts: 278
Registered: ‎11-29-2008
Message 10 of 11 (207 Views)

Re: Entity advice

02-29-2012 04:40 PM in reply to: matus.brlit

matus.brlit wrote:

>>> the way to create "custom objects" in .NET is the Overrule API

 

 


No,  words have meanings.

//-------------------------------------------------------

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.