.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Current DimStyle

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
junoj
778 Views, 5 Replies

Current DimStyle

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.

Tags (1)
5 REPLIES 5
Message 2 of 6
mzakiralam
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...

 

Message 3 of 6
junoj
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.

 

Message 4 of 6
_gile
in reply to: junoj

hi,

 

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



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 6
junoj
in reply to: _gile

Gilles, can you please show me an example.

Message 6 of 6
junoj
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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost