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

Updating of User Variable ( Parameters ) with VB.Net

1 REPLY 1
Reply
Message 1 of 2
murali.koppu
663 Views, 1 Reply

Updating of User Variable ( Parameters ) with VB.Net

Dear All,
This is K.Murali kumar ( Programmer )
I want to Access User Variables which are created in Parameter Dialog Box through VB.Net Program.
Please any one help me.
How to Access the User variables.
Secondly i want to Update the User Variables with VB.Net Program.


I able to access the Dimensional Constraints with the below code

'-----------------------------
' Filling the Dimensional Constraints in a ListBox on from
'-------------------------------
Tools.ZoomExtents()
'
Dim acTypValAr(0) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "*ADSK_CONSTRAINTS*"), 0)
Dim Flt As New Autodesk.AutoCAD.EditorInput.SelectionFilter(acTypValAr)
Dim Sset As Autodesk.AutoCAD.EditorInput.PromptSelectionResult = Tools.Editor.SelectAll(Flt)
'
ListBox1.Items.Clear()
Dim oID As ObjectId
If Sset.Value IsNot Nothing Then
For i As Integer = 0 To Sset.Value.Count - 1
oID = Sset.Value.Item(i).ObjectId
Dim Ent As Entity = Tools.GetEntity(oID)
Dim EntType As String = UCase(Ent.ToString)
If EntType = UCase("Autodesk.AutoCAD.DatabaseServices.DiametricDimension") Then
Dim DD As DiametricDimension = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
ElseIf EntType = UCase("Autodesk.AutoCAD.DatabaseServices.LineAngularDimension2") Then
Dim DD As LineAngularDimension2 = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
ElseIf EntType = UCase("Autodesk.AutoCAD.DatabaseServices.AlignedDimension") Then
Dim DD As AlignedDimension = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
End If
Next
End If
ListBox1.Sorted = True

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: murali.koppu

There's no managed API for accessing contstraints or parameters.

There is a native API, but I haven't had a chance to explore it, so I can't
tell you if it allows you to do what you want, but I will dare to say that
not providing a high-level API to access variables used in constraint
parameters was an incredibly stupid decision, not to mention grossly
neglegent.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6293549@discussion.autodesk.com...
Dear All,
This is K.Murali kumar ( Programmer )
I want to Access User Variables which are created in Parameter Dialog Box
through VB.Net Program.
Please any one help me.
How to Access the User variables.
Secondly i want to Update the User Variables with VB.Net Program.

I able to access the Dimensional Constraints with the below code

'-----------------------------
' Filling the Dimensional Constraints in a ListBox on from
'-------------------------------
Tools.ZoomExtents()
'
Dim acTypValAr(0) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "*ADSK_CONSTRAINTS*"),
0)
Dim Flt As New Autodesk.AutoCAD.EditorInput.SelectionFilter(acTypValAr)
Dim Sset As Autodesk.AutoCAD.EditorInput.PromptSelectionResult =
Tools.Editor.SelectAll(Flt)
'
ListBox1.Items.Clear()
Dim oID As ObjectId
If Sset.Value IsNot Nothing Then
For i As Integer = 0 To Sset.Value.Count - 1
oID = Sset.Value.Item(i).ObjectId
Dim Ent As Entity = Tools.GetEntity(oID)
Dim EntType As String = UCase(Ent.ToString)
If EntType = UCase("Autodesk.AutoCAD.DatabaseServices.DiametricDimension")
Then
Dim DD As DiametricDimension = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
ElseIf EntType =
UCase("Autodesk.AutoCAD.DatabaseServices.LineAngularDimension2") Then
Dim DD As LineAngularDimension2 = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
ElseIf EntType = UCase("Autodesk.AutoCAD.DatabaseServices.AlignedDimension")
Then
Dim DD As AlignedDimension = Ent
Dim DimVal As String = DD.DimensionText
ListBox1.Items.Add(DimVal)
End If
Next
End If
ListBox1.Sorted = True

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