Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"plamp" wrote in messageDear
title="news:6136485@discussion.autodesk.com CTRL + Click to follow link"
href="news:6136485@di......
Forum Users; I've been working with .NET and the AutoCAD API for a while now,
but here's something I really don't get. I've added an entity to a drawing,
that contains the following XData (each line represents a new TypedValue):
type: 1001, value: 200903021622150430002 type: 1002, value: { type: 1000,
value: Somestring type: 1002, value: } The value displayed in the first
xdata-line is a RegAppName which I have added as a RegAppTableRecord to the
RegAppTable. My drawing is full of entities, but I'd like to find exáctly this
entity. I do this by creating a selection filter and calling the selectAll
method on the Autodesk.Autocad.EditorInput.Editor-object. See the sample code
below {code} 'variable ID is of string value "200903021622150430002" Dim ent
As Entity = nothing Dim filter As TypedValue() = {New
TypedValue(DxfCode.ExtendedDataRegAppName, ID)} Dim selfilter As New
SelectionFilter(filter) Dim pres As PromptSelectionResult =
ed.SelectAll(selfilter) If Not pres.Value Is Nothing Then Dim idarray As
ObjectId() = pres.Value.GetObjectIds() If idarray.Length > 0 Then Using tr
As Transaction = db.TransactionManager.StartTransaction Try ent =
DirectCast(tr.GetObject(idarray(0), OpenMode.ForRead, False), Entity) Catch ex
As System.Exception Debug.WriteLine(ex.Message) End Try End Using End If End
If {code} The Problem; This method does not álways seem to work. In most
cases, the entity i am looking for will be found and retrieved by from the
Database. However, sometimes PromptSectionResult.Value is just Nothing. What
could be the possible cause of (and solution to) this? i already tried
recovering the drawing, thus no errors might exist in the drawing i guess¿
Also, adding a typedvalue that contains DxfCode.XDataSTart does not make a
difference: Dim filter As TypedValue() = {New TypedValue(DxfCode.XDataStart),
New TypedValue(DxfCode.ExtendedDataRegAppName, ID)}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Joe Sutphin" <
href="mailto:joesutphin@embarqmail.com">joesutphin@embarqmail.com>
wrote in message
href="news:6137158@discussion.autodesk.com">news:6137158@discussion.autodesk.com...
This is a test in Rich Text format.
Option Explicit
Private Const MAX_COMPUTERNAME_LENGTH As Long =
31
Private Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As
Long
Private Sub Form_Load()
Dim dwLen As
Long
Dim strString As String
'Create a
buffer
dwLen = MAX_COMPUTERNAME_LENGTH + 1
strString =
String(dwLen, "X")
'Get the computer name
GetComputerName
strString, dwLen
'get only the actual data
strString =
Left(strString, dwLen)
'Show the computer name
Label1.Caption = strString
End Sub
Joe ...
"Tony Tanzillo" <If one is using a
href="mailto:tony.tanzillo@THE_URL_BELOW.com">
size=2>tony.tanzillo@THE_URL_BELOW.com>
wrote in message
face=Arial size=2>news:6136975@discussion.autodesk.com
face=Arial size=2>...
newsreader, that doesn't help, and code tags
or not, the entire message
content is word-wrapped.
--
href="http://www.caddzone.com">
size=2>http://www.caddzone.com
size=2>AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
face=Arial size=2>http://www.acadxtabs.com
size=2>Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">
size=2>http://www.caddzone.com/acad...
face=Arial size=2>"Kerry Brown" <
face=Arial size=2>kwb@home> wrote in
message
face=Arial size=2>news:6136493@discussion.autodesk.com
face=Arial size=2>...
href="http://discussion.autodesk.com/forums/ann.jspa?annID=125">
face=Arial
size=2>http://di...
face=Arial size=2> "plamp" wrote in message
href="news:6136485@discussion.autodesk.com">
size=2>news:6136485@discussion.autodesk.com
size=2>...
Dear Forum Users; I've been working with .NET and the
AutoCAD API for a
while now, but here's something I really don't get. I've
added an entity to
a drawing, that contains the following XData (each line
represents a new
TypedValue): type: 1001, value: 200903021622150430002
type: 1002, value: {
type: 1000, value: Somestring type: 1002, value: }
The value displayed in
the first xdata-line is a RegAppName which I have
added as a
RegAppTableRecord to the RegAppTable. My drawing is full of
entities, but
I'd like to find exáctly this entity. I do this by creating
a selection
filter and calling the selectAll method on the
Autodesk.Autocad.EditorInput.Editor-object. See the sample code below
{code}
'variable ID is of string value "200903021622150430002" Dim ent As
Entity =
nothing Dim filter As TypedValue() = {New
TypedValue(DxfCode.ExtendedDataRegAppName, ID)} Dim selfilter As New
SelectionFilter(filter) Dim pres As PromptSelectionResult =
ed.SelectAll(selfilter) If Not pres.Value Is Nothing Then Dim idarray As
ObjectId() = pres.Value.GetObjectIds() If idarray.Length > 0 Then Using
tr
As Transaction = db.TransactionManager.StartTransaction Try ent =
DirectCast(tr.GetObject(idarray(0), OpenMode.ForRead, False), Entity)
Catch
ex As System.Exception Debug.WriteLine(ex.Message) End Try End Using
End If
End If {code} The Problem; This method does not álways seem to
work. In most
cases, the entity i am looking for will be found and
retrieved by from the
Database. However, sometimes
PromptSectionResult.Value is just Nothing. What
could be the possible
cause of (and solution to) this? i already
tried recovering the
drawing, thus no errors might exist in the drawing i
guess¿ Also, adding a
typedvalue that contains DxfCode.XDataSTart does not
make a difference:
Dim filter As TypedValue() = {New
TypedValue(DxfCode.XDataStart), New
TypedValue(DxfCode.ExtendedDataRegAppName, ID)}