.NET

Reply
Member
shaikmuneer
Posts: 4
Registered: ‎01-23-2007
Message 1 of 15 (392 Views)

how to set or get the systemvariables

392 Views, 14 Replies
02-07-2007 03:50 AM
Hello,

i want to get or set the system variables in managed .net application. please help me how to do this

Shaik Esu
*GPaolo
Message 2 of 15 (392 Views)

Re: how to set or get the systemvariables

02-07-2007 07:15 AM in reply to: shaikmuneer
for setting:

Autodesk..autocad.Application.SetSystemVariable("PICKSTYLE", 0)

for read:

dim var as object

var=Autodesk..autocad.Application.GetSystemVariable("PICKSTYLE")

try this

Ciao

GPaolo



ha scritto nel messaggio
news:5477760@discussion.autodesk.com...
Hello,

i want to get or set the system variables in managed .net application.
please help me how to do this

Shaik Esu
*Tony Tanzillo
Message 3 of 15 (392 Views)

Re: how to set or get the systemvariables

02-08-2007 08:52 PM in reply to: shaikmuneer
It depends on the type of system variable.

For those that are saved with each drawing,
most are properties of the Database object.

For others, use the methods GPaulo shows.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5477760@discussion.autodesk.com...
Hello,

i want to get or set the system variables in managed .net application. please help me how to do this

Shaik Esu
Member
HugoCef
Posts: 3
Registered: ‎06-11-2007
Message 4 of 15 (392 Views)

Re: how to set or get the systemvariables

06-11-2007 08:51 AM in reply to: shaikmuneer
How i CAN set the DIM variable (DIMBLCK) in a vb.net application, I Need to change from "Closed Filled" To "_ArchiTick". please help me how to do this
Distinguished Contributor
Fatty
Posts: 1,986
Registered: ‎08-02-2004
Message 5 of 15 (392 Views)

Re: how to set or get the systemvariables

06-11-2007 11:33 AM in reply to: shaikmuneer
Hi
Here is two subs
First one will be to change arrow blocks
for the selected dimension, second one
will be to change system variables
You need to varnish these both because they
are was written quickly

~'J'~

_
Public Sub ChangeArrowBlock()
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim prOpt As PromptEntityOptions = New PromptEntityOptions(vbCr & "Select Dimension To Change Arrow Block: ")
prOpt.SetRejectMessage(vbCr & "Only Dimensions may be selected.")
prOpt.AddAllowedClass(GetType(AlignedDimension), True)
prOpt.AddAllowedClass(GetType(RotatedDimension), True)
prOpt.AddAllowedClass(GetType(ArcDimension), True)
prOpt.AddAllowedClass(GetType(LineAngularDimension2), True)
prOpt.AddAllowedClass(GetType(DiametricDimension), True)
prOpt.AddAllowedClass(GetType(Point3AngularDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimensionLarge), True)

Dim rs As PromptEntityResult = ed.GetEntity(prOpt)
If rs.Status = PromptStatus.OK Then
Using trans As Transaction = db.TransactionManager.StartTransaction()
Dim dime As Dimension = CType(trans.GetObject(rs.ObjectId, OpenMode.ForWrite), Dimension)
If Not dime Is Nothing Then
' here we go:
Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(trans.GetObject(bt.Item("_ARCHTICK"), OpenMode.ForRead), BlockTableRecord)
Dim blkId As ObjectId = btr.ObjectId
Dim dtr As DimStyleTableRecord = dime.GetDimstyleData

dtr.Dimblk = blkId
dtr.Dimblk1 = blkId
dtr.Dimblk2 = blkId
MsgBox(dtr.Name)
dime.SetDimstyleData(dtr)
' if you need to change arrows for dimstyle also:
'db.SetDimstyleData(dtr)
ed.Regen()
Else
MsgBox("You are stumb as always, Fatty")
End If
trans.Commit()
End Using
End If
End Sub
_
Public Sub ChangeArrowBlockSysVar()

Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Using trans As Transaction = db.TransactionManager.StartTransaction()

Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(trans.GetObject(bt.Item("_ARCHTICK"), OpenMode.ForRead), BlockTableRecord)
Dim blkId As ObjectId = btr.ObjectId
db.Dimblk = blkId
db.Dimblk1 = blkId
db.Dimblk2 = blkId
trans.Commit()

End Using
End Sub
*Tony Tanzillo
Message 6 of 15 (392 Views)

Re: how to set or get the systemvariables

06-12-2007 08:04 PM in reply to: shaikmuneer
This wrong:

prOpt.AddAllowedClass(GetType(AlignedDimension), True)
prOpt.AddAllowedClass(GetType(RotatedDimension), True)
prOpt.AddAllowedClass(GetType(ArcDimension), True)
prOpt.AddAllowedClass(GetType(LineAngularDimension2), True)
prOpt.AddAllowedClass(GetType(DiametricDimension), True)
prOpt.AddAllowedClass(GetType(Point3AngularDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimensionLarge), True)

Instead of all of that, only this is needed:

prOpt.AddAllowedClass(GetType(Dimension), False)

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5622592@discussion.autodesk.com...
Hi
Here is two subs
First one will be to change arrow blocks
for the selected dimension, second one
will be to change system variables
You need to varnish these both because they
are was written quickly

~'J'~

_
Public Sub ChangeArrowBlock()
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim prOpt As PromptEntityOptions = New PromptEntityOptions(vbCr & "Select Dimension To Change Arrow Block: ")
prOpt.SetRejectMessage(vbCr & "Only Dimensions may be selected.")
prOpt.AddAllowedClass(GetType(AlignedDimension), True)
prOpt.AddAllowedClass(GetType(RotatedDimension), True)
prOpt.AddAllowedClass(GetType(ArcDimension), True)
prOpt.AddAllowedClass(GetType(LineAngularDimension2), True)
prOpt.AddAllowedClass(GetType(DiametricDimension), True)
prOpt.AddAllowedClass(GetType(Point3AngularDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimension), True)
prOpt.AddAllowedClass(GetType(RadialDimensionLarge), True)

Dim rs As PromptEntityResult = ed.GetEntity(prOpt)
If rs.Status = PromptStatus.OK Then
Using trans As Transaction = db.TransactionManager.StartTransaction()
Dim dime As Dimension = CType(trans.GetObject(rs.ObjectId, OpenMode.ForWrite), Dimension)
If Not dime Is Nothing Then
' here we go:
Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(trans.GetObject(bt.Item("_ARCHTICK"), OpenMode.ForRead), BlockTableRecord)
Dim blkId As ObjectId = btr.ObjectId
Dim dtr As DimStyleTableRecord = dime.GetDimstyleData

dtr.Dimblk = blkId
dtr.Dimblk1 = blkId
dtr.Dimblk2 = blkId
MsgBox(dtr.Name)
dime.SetDimstyleData(dtr)
' if you need to change arrows for dimstyle also:
'db.SetDimstyleData(dtr)
ed.Regen()
Else
MsgBox("You are stumb as always, Fatty")
End If
trans.Commit()
End Using
End If
End Sub
_
Public Sub ChangeArrowBlockSysVar()

Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Using trans As Transaction = db.TransactionManager.StartTransaction()

Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(trans.GetObject(bt.Item("_ARCHTICK"), OpenMode.ForRead), BlockTableRecord)
Dim blkId As ObjectId = btr.ObjectId
db.Dimblk = blkId
db.Dimblk1 = blkId
db.Dimblk2 = blkId
trans.Commit()

End Using
End Sub
Distinguished Contributor
Fatty
Posts: 1,986
Registered: ‎08-02-2004
Message 7 of 15 (392 Views)

Re: how to set or get the systemvariables

06-12-2007 11:28 PM in reply to: shaikmuneer
>> Instead of all of that, only this is needed:

>> prOpt.AddAllowedClass(GetType(Dimension), False)

Thanks, but I've tried it before, will not
worked for me (A2007)
and works good with exact types
Regards,


~'J'~
*Tony Tanzillo
Message 8 of 15 (392 Views)

Re: how to set or get the systemvariables

06-13-2007 12:58 AM in reply to: shaikmuneer
Sorry Fatty, you're mistaken.

It works perfectly here.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5624432@discussion.autodesk.com...
>> Instead of all of that, only this is needed:

>> prOpt.AddAllowedClass(GetType(Dimension), False)

Thanks, but I've tried it before, will not
worked for me (A2007)
and works good with exact types
Regards,


~'J'~
Distinguished Contributor
Fatty
Posts: 1,986
Registered: ‎08-02-2004
Message 9 of 15 (392 Views)

Re: how to set or get the systemvariables

06-13-2007 01:07 AM in reply to: shaikmuneer
Pardon me, Tony
You are right as always, I was mistaken
because I 've selected the certain dimension types
only, therefore cause is on

Regards,
my friends called me Oleg
Cheers :smileyhappy:

~'J'~
*Tony Tanzillo
Message 10 of 15 (392 Views)

Re: how to set or get the systemvariables

06-13-2007 01:14 AM in reply to: shaikmuneer
Fatty, if you only want certain dimension types,
then what you show is fine, but I don't think it
was what the OP seemed to need.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5624453@discussion.autodesk.com...
Pardon me, Tony
You are right as always, I was mistaken
because I 've selected the certain dimension types
only, therefore cause is on

Regards,
my friends called me Oleg
Cheers :smileyhappy:

~'J'~

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