text & insertionpoint problem

text & insertionpoint problem

Anonymous
Not applicable
283 Views
1 Reply
Message 1 of 2

text & insertionpoint problem

Anonymous
Not applicable
hola i got a code that selects the object in a acadfile then filters the "text" objects. then i want to find out the insertion point of this text objects. acadtext.insertionpoint is fine when u create a new text by using a code that creates actext. when i filter the same objects with "actext" i got nothing. i thought it has to be the same with "text". Sub exportdata() Dim sset As AcadSelectionSet Dim filtertype(0) As Integer Dim filtervalue(0) As Variant Dim yazi As String Dim boy() As String Dim nokta As Variant On Error Resume Next ThisDrawing.SelectionSets.Item("data").Delete Set sset = ThisDrawing.SelectionSets.Add("data") filtertype(0) = 0 filtervalue(0) = "text" sset.SelectOnScreen filtertype, filtervalue say = sset.Count For i = 1 To say - 1 yazi = sset.Item(i).TextString boy = Split(yazi, , , vbTextCompare) nokta = sset.Item(i).InsertionPoint !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Next i End Sub when i try to print.debug nokta(i) i get nothing. where is the mistake? anyone can help thnx.
0 Likes
284 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
An insertion point is a 3d point, which is an array of 3 doubles. You can't just print an array, you have to print each item at each index. You are trying to print nokta(i), but what value does i have? The x,y,z coords will always be at 0,1,2. Thus: Debug.Print nokta(0): Debug.Print nokta(1): Debug.Print nokta(2) BTW, you didn't dim "say". If you always include "Option Explicit" in your modules Declaration, the ide will alert you to this error. If you have "Options>Editor tab>Require Variable Declaration" checked, the option will be added when you create a new module. -- ---- Ed ---- "fischer" wrote in message news:41534989_2@newsprd01... > hola > > i got a code that selects the object in a acadfile then filters the "text" > objects. then i want to find out the insertion point of this text objects. > > acadtext.insertionpoint is fine when u create a new text by using a code > that creates actext. > > when i filter the same objects with "actext" i got nothing. i thought it has > to be the same with "text". > > > Sub exportdata() > > Dim sset As AcadSelectionSet > Dim filtertype(0) As Integer > Dim filtervalue(0) As Variant > Dim yazi As String > Dim boy() As String > Dim nokta As Variant > > > > On Error Resume Next > ThisDrawing.SelectionSets.Item("data").Delete > Set sset = ThisDrawing.SelectionSets.Add("data") > > filtertype(0) = 0 > filtervalue(0) = "text" > sset.SelectOnScreen filtertype, filtervalue > say = sset.Count > For i = 1 To say - 1 > yazi = sset.Item(i).TextString > boy = Split(yazi, , , vbTextCompare) > nokta = sset.Item(i).InsertionPoint > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! > Next i > > End Sub > > when i try to print.debug nokta(i) i get nothing. > > where is the mistake? > > anyone can help > > thnx. > > >
0 Likes