.NET

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

Current DimStyle

254 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.

Mentor
mzakiralam
Posts: 225
Registered: ‎11-09-2012
Message 2 of 6 (246 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 (233 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,071
Registered: ‎04-29-2006
Message 4 of 6 (219 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 (206 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 (200 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

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community