habakay Posted June 9, 2014 Share Posted June 9, 2014 Hi, I want to macth the text objects in selection set and send them to excel as noted below. How can I match these texts? Do you have any suggestion? ...........A................B 1.....Km=0+120...4,0565 m2 2.....Km=0+122...4,3288 m2 3.....Km=0+140...5,4556 m2 4.....Km=0+160...3,5632 m2 5.....Km=0+180...4,4373 m2 ... Quote Link to comment Share on other sites More sharing options...
RICVBA Posted June 9, 2014 Share Posted June 9, 2014 You mean you want to match text objects having textstring beginning with "KM" or ending with "m2", don't you? Quote Link to comment Share on other sites More sharing options...
habakay Posted June 10, 2014 Author Share Posted June 10, 2014 Yes. KM=0+120.000 belongs to 4.0565 m2 KM=0+122.000 belongs to 4.3288 m2 KM=0+140.000 belongs to 5.4556 m2 KM=0+160.000 belongs to 3.5632 m2 ... Quote Link to comment Share on other sites More sharing options...
RICVBA Posted June 10, 2014 Share Posted June 10, 2014 there must be some sort of rule to allow the program understand which "KM..." string to associate with which "...m2" string for instance: - the "paired" text objects share the same layer, which is different from any other "paired" textobjects one - the relative position of the two paired text objects is always the same (same difference of X and/or Y coordinate) - other Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 11, 2014 Share Posted June 11, 2014 Two steps find the Text KM=0+120.000 then you can get its insertion point, 2nd step is use SSGET with the "W" option a window of approximately the size to find the m2 text this window is based on the insertion point of the first found text, you can also have extra filters so that it only finds the text on a certain layer. Can do no more without a sample dwg Quote Link to comment Share on other sites More sharing options...
habakay Posted June 16, 2014 Author Share Posted June 16, 2014 (edited) there must be some sort of rule to allow the program understand which "KM..." string to associate with which "...m2" stringfor instance: - the "paired" text objects share the same layer, which is different from any other "paired" textobjects one - the relative position of the two paired text objects is always the same (same difference of X and/or Y coordinate) - other Thanks for your advice RICVBA. I also try to solve with coordinates. Two steps find the Text KM=0+120.000 then you can get its insertion point, 2nd step is use SSGET with the "W" option a window of approximately the size to find the m2 text this window is based on the insertion point of the first found text, you can also have extra filters so that it only finds the text on a certain layer. Can do no more without a sample dwg Thanks BIGAL. I'm a little new to AutoCAD VBA. I didn't use SSGET before. I attach the .dwg file. I will be glad if you can do small example . Sample.rar Edited June 16, 2014 by habakay Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 17, 2014 Share Posted June 17, 2014 Please post a dwg or a zip not Rar file. Quote Link to comment Share on other sites More sharing options...
habakay Posted June 17, 2014 Author Share Posted June 17, 2014 Ok. I post the dwg. ENKESİTLER.dwg Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 17, 2014 Share Posted June 17, 2014 Please note that SSGET is an AutoLISP function, not a VBA one. In VBA, a selection set should be first registered and just after defined: Set selSetAll = ThisDrawing.SelectionSets.Add("SS1") selSetAll.Select Mode := acSelectionSetAll Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.