Jump to content

Matching members of selection set


habakay

Recommended Posts

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

...

Sample.jpg

Link to comment
Share on other sites

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 ...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

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 by habakay
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...