.NET

Reply
Valued Contributor
FRPT1257
Posts: 69
Registered: ‎05-03-2006
Message 1 of 6 (149 Views)
Accepted Solution

Newbie in AutoCAD .NET API

149 Views, 5 Replies
07-18-2014 03:22 PM

Hi,

 

I need some C# sample code about the following features in AutoCAD .NET API:

- Create an custom menu/ribbon in AutoCAD;

- Detect XRefs of an AutoCAD drawing;

- Create/update an drawing legend in AutoCAD

 

Thanks & Regards,

Rui

public void EnumProperties(ref Database db)
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
DatabaseSummaryInfo info = db.SummaryInfo;
System.Collections.IDictionaryEnumerator cust = info.CustomProperties;
while (cust.MoveNext) {
object item = cust.Current;
string key = item.key;
string value = item.Value;
ed.WriteMessage("\nKey={0} Value={1}.", key, value);
}
}

 

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 2 of 6 (142 Views)

Re: Newbie in AutoCAD .NET API

07-18-2014 04:02 PM in reply to: FRPT1257

>> I need some C# sample code about the following features in AutoCAD .NET API:

>> - Create an custom menu/ribbon in AutoCAD;

http://adndevblog.typepad.com/autocad/2012/07/modify-ribbon.html

and CuiSamp sample form ObjectARX SDK 2009

>> - Detect XRefs of an AutoCAD drawing;

http://adndevblog.typepad.com/autocad/2012/08/analysing-nested-xref-in-drawings.html

>> - Create/update an drawing legend in AutoCAD

What do you mean???


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
FRPT1257
Posts: 69
Registered: ‎05-03-2006
Message 3 of 6 (116 Views)

Re: Newbie in AutoCAD .NET API

07-19-2014 02:58 AM in reply to: Alexander.Rivilis

Alexander.Rivilis wrote:

>> I need some C# sample code about the following features in AutoCAD .NET API:

>> - Create an custom menu/ribbon in AutoCAD;

http://adndevblog.typepad.com/autocad/2012/07/modify-ribbon.html

and CuiSamp sample form ObjectARX SDK 2009

>> - Detect XRefs of an AutoCAD drawing;

http://adndevblog.typepad.com/autocad/2012/08/analysing-nested-xref-in-drawings.html

>> - Create/update an drawing legend in AutoCAD

What do you mean???


Well, in AutoCAD drawings we can have an legend with some attributes like: File Name, Check Date, Revision, Check Date, Contact Number, Checked By, …

I want set the value of these attributes, and create new attributes.

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 4 of 6 (114 Views)

Re: Newbie in AutoCAD .NET API

07-19-2014 03:05 AM in reply to: FRPT1257

FRPT1257 wrote:
Well, in AutoCAD drawings we can have an legend with some attributes like: File Name, Check Date, Revision, Check Date, Contact Number, Checked By, …

I want set the value of these attributes, and create new attributes.


http://adndevblog.typepad.com/autocad/2012/05/writing-autocad-drawing-summary-information.html


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
FRPT1257
Posts: 69
Registered: ‎05-03-2006
Message 5 of 6 (95 Views)

Re: Newbie in AutoCAD .NET API

07-19-2014 05:01 PM in reply to: Alexander.Rivilis

How to all attributes (Name/Value)?

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 6 of 6 (87 Views)

Re: Newbie in AutoCAD .NET API

07-20-2014 03:09 AM in reply to: FRPT1257
public void EnumProperties(ref Database db)
{
    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
    DatabaseSummaryInfo info = db.SummaryInfo;
    System.Collections.IDictionaryEnumerator cust = info.CustomProperties;
    while (cust.MoveNext) {
    	object item = cust.Current;
    	string key = item.key;
    	string value = item.Value;
        ed.WriteMessage("\nKey={0} Value={1}.", key, value);
    }
}

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

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.