What do I do now?

What do I do now?

Anonymous
Not applicable
256 Views
4 Replies
Message 1 of 5

What do I do now?

Anonymous
Not applicable
I had never used the User variables before, and so I checked out Useri1 and saw
that it was saved in the drawing. I foolishly figured the other User variables
were also, and got most of the way thru my program before I tried saving the
drawing and reopening it. Of course I found that Users variables aren't saved.
(Why the heck aren't they?)

Anyhow how do you save strings in a drawing, to be easily accessable by the
program every time?

--
Kent Keller

Check out the Mechanical Desktop FAQ @
http://webhome.idirect.com/~dfulford/
0 Likes
257 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Kent,

Why not with XDATA ?

Bernard
Kent Keller a écrit dans le message :
221D97E7C41E3E0132FF7B8261ED7352@in.WebX.SaUCah8kaAW...
> I had never used the User variables before, and so I checked out Useri1
and saw
> that it was saved in the drawing. I foolishly figured the other User
variables
> were also, and got most of the way thru my program before I tried saving
the
> drawing and reopening it. Of course I found that Users variables aren't
saved.
> (Why the heck aren't they?)
>
> Anyhow how do you save strings in a drawing, to be easily accessable by
the
> program every time?
>
> --
> Kent Keller
>
> Check out the Mechanical Desktop FAQ @
> http://webhome.idirect.com/~dfulford/
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Bernard

I have never dealt with XDATA (that I know of anyhow) Is it pretty easy to
work with? I will have to do some studying on it tomorrow, To late tonight 8)

Thanks for the suggestion.

--
Kent Keller

Check out the Mechanical Desktop FAQ @
http://webhome.idirect.com/~dfulford/

"Bernard Flavignard" wrote in message
news:B679AA88056C0F0B06EBD434338E91ED@in.WebX.SaUCah8kaAW...
> Kent,
>
> Why not with XDATA ?
>
> Bernard
0 Likes
Message 4 of 5

Anonymous
Not applicable
Kent,

I do only one example for this, but you can look the Vlisp help and surch
XDATA, i think you can work with this. With an object, you can input XDATA
with the setxdata method and read it with the getxdata method

From the help

Sub Example_SetXdata()
' This example creates a line and attaches extended data to that line.

' Create the line
Dim lineObj As AcadLine
Dim startPt(0 To 2) As Double, endPt(0 To 2) As Double
startPt(0) = 1#: startPt(1) = 1#: startPt(2) = 0#
endPt(0) = 5#: endPt(1) = 5#: endPt(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)

ZoomAll

' Initialize all the xdata values. Note that first data in the list
should be
' application name and first datatype code should be 1001
Dim DataType(0 To 9) As Integer
Dim Data(0 To 9) As Variant
Dim reals3(0 To 2) As Double
Dim worldPos(0 To 2) As Double

DataType(0) = 1001: Data(0) = "Test_Application"

DataType(1) = 1000: Data(1) = "This is a test for xdata"

DataType(2) = 1003: Data(2) = "0" ' layer
DataType(3) = 1040: Data(3) = 1.23479137438413E+40 ' real
DataType(4) = 1041: Data(4) = 1237324938 ' distance
DataType(5) = 1070: Data(5) = 32767 ' 16 bit Integer
DataType(6) = 1071: Data(6) = 32767 ' 32 bit Integer

DataType(7) = 1042: Data(7) = 10 ' scaleFactor

reals3(0) = -2.95: reals3(1) = 100: reals3(2) = -20
DataType(8) = 1010: Data(8) = reals3 ' real

worldPos(0) = 4: worldPos(1) = 400.99999999: worldPos(2) = 2.798989
DataType(9) = 1011: Data(9) = worldPos ' world space
position

' Attach the xdata to the line
lineObj.SetXData DataType, Data

' Return the xdata for the line
Dim xdataOut As Variant
Dim xtypeOut As Variant
lineObj.GetXData "", xtypeOut, xdataOut

End Sub

Bernard
Kent Keller a écrit dans le message :
4A3F83D4B01A2EF58C760813833A24D5@in.WebX.SaUCah8kaAW...
> Bernard
>
> I have never dealt with XDATA (that I know of anyhow) Is it pretty easy
to
> work with? I will have to do some studying on it tomorrow, To late
tonight 8)
>
> Thanks for the suggestion.
>
> --
> Kent Keller
>
> Check out the Mechanical Desktop FAQ @
> http://webhome.idirect.com/~dfulford/
>
> "Bernard Flavignard" wrote in message
> news:B679AA88056C0F0B06EBD434338E91ED@in.WebX.SaUCah8kaAW...
> > Kent,
> >
> > Why not with XDATA ?
> >
> > Bernard
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
You're better off using xdata (for appliation data that is entity-specific)
or dictionaries (for application data that is drawing-specific).

--
Attitudes are contagious. Is yours worth catching?
http://www.acadx.com

"Kent Keller" wrote in message
news:221D97E7C41E3E0132FF7B8261ED7352@in.WebX.SaUCah8kaAW...
> I had never used the User variables before, and so I checked out Useri1
and saw
> that it was saved in the drawing. I foolishly figured the other User
variables
> were also, and got most of the way thru my program before I tried saving
the
> drawing and reopening it. Of course I found that Users variables aren't
saved.
> (Why the heck aren't they?)
>
> Anyhow how do you save strings in a drawing, to be easily accessable by
the
> program every time?
>
> --
> Kent Keller
>
> Check out the Mechanical Desktop FAQ @
> http://webhome.idirect.com/~dfulford/
>
0 Likes