View Full Version : Need HeLp
YosSa
05-02-2004, 02:03 PM
When i select a line :
ThisDrawing.Utility.GetEntity roteet_object, rtpoint, "Select:"
I can filter the angle by :
angleobject = roteet_object.Angle
But how can i filter the Start X, End X or Delta X ??
grtz
Don't know exactly what you want but here is some example code on how to select a line and get its deltax and startx values.
Function FindStartx_DeltaX()
Dim SelSet As AcadSelectionSet
Dim i As AcadLine
'You must define a Selection set an call it adifferent name in
'each session of AutoCAD
Set SelSet = ThisDrawing.SelectionSets.Add(InputBox("Tell Me"))
'We then specify that we want to select an object from autocad.
SelSet.SelectOnScreen
'We then say that for each line in the selection set we would like to see
the
'following properties.
For Each i In SelSet
MsgBox i.Delta(0)
MsgBox i.Delta(1)
MsgBox i.StartPoint(0)
MsgBox i.StartPoint(1)
Next i
'Delta x Is Delta(0) Delta y is Delta(1) Delta Z would be Delta(2)
'StartX is Start Point(0) etc..
End Function
Hope this helps :shock:
YosSa
06-02-2004, 08:20 AM
Hi PJ, thnx for reply
It is almost what i want, for 1 thing that isn't how i want it to.
The selectionmodes. Now i can select more then 1 item but i want people just to select 1 item. Like in getent.
get it ?
Hi,
The code below will enable you to select just one object at a time.
I hope it helps!
:P
Function FindStartx_DeltaX()
Dim returnObj As AcadLine
Dim basePnt As Variant
'We simply use the getentity object as below, making the variable returnobj a autocad line
'Once selected it will return the values.
RETRY:
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
MsgBox returnObj.Delta(0)
MsgBox returnObj.Delta(1)
MsgBox returnObj.startPoint(0)
MsgBox returnObj.startPoint(1)
'Delta x Is Delta(0) Delta y is Delta(1) Delta Z would be Delta(2)
'StartX is Start Point(0) etc..
End Function
YosSa
06-02-2004, 12:20 PM
The Code you gave is the 1 i used in the beginning, because its the most logical one.
But it didnt work ...
But ..
now it does .. i really dont get it.
thnx m8 :P
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.