.NET

Reply
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 1 of 6 (303 Views)
Accepted Solution

Current DimStyle

303 Views, 5 Replies
08-14-2013 03:45 PM

Hi, I am trying to find out what the current DimStyle of the drawing.

I have iterated through all DimStyle but can’t find any way of finding the current Style.

 

For Each DsrID In DST
     Dim R As DimStyleTableRecord = CType(DsrID.GetObject(OpenMode.ForRead), DBObject)
     Debug.Print(R.Name)
Next

 Please help.

 

Thank you.

hi,

 

The Database class do have a Dimstyle property to access the ObjectId of the current dimstyle.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (295 Views)

Re: Current DimStyle

08-14-2013 05:03 PM in reply to: junoj

try to get the what system variable "DIMSTYLE" returns. this system variable will return the current style. you can go through the below link for details of this system variable.

 

http://exchange.autodesk.com/autocad/enu/online-help/browse#WS1a9193826455f5ffa23ce210c4a30acaf-5041...

 

Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 3 of 6 (282 Views)

Re: Current DimStyle

08-14-2013 06:41 PM in reply to: mzakiralam

Thank you Mzakiralam for a quick response.

 

I am not sure if this will work because I am accessing the drawings without physically opening them. GetSystemVariable requires Applicatio

Dim str As String = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DIMSYLE")

My only way currently accessing is via Database.

 

*Expert Elite*
_gile
Posts: 2,114
Registered: ‎04-29-2006
Message 4 of 6 (268 Views)

Re: Current DimStyle

08-15-2013 01:20 AM in reply to: junoj

hi,

 

The Database class do have a Dimstyle property to access the ObjectId of the current dimstyle.

Gilles Chanteau
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 5 of 6 (255 Views)

Re: Current DimStyle

08-15-2013 08:05 AM in reply to: _gile

Gilles, can you please show me an example.

Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 6 of 6 (249 Views)

Re: Current DimStyle

08-15-2013 08:18 AM in reply to: _gile

Gilles, I got it, thanks

 

Dim DimSyleID = Me._WorkingDB.Dimstyle
Dim DwgDimSyle As DimStyleTableRecord = CType(DimSyleID.GetObject(OpenMode.ForRead), DBObject)

 Thanks again

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!