.NET

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

Current DimStyle

287 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 (279 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 (266 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,105
Registered: ‎04-29-2006
Message 4 of 6 (252 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 (239 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 (233 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.