mark polyline that touch a (dynamic) block

mark polyline that touch a (dynamic) block

jtm2020hyo
Collaborator Collaborator
1,921 Views
8 Replies
Message 1 of 9

mark polyline that touch a (dynamic) block

jtm2020hyo
Collaborator
Collaborator

If possible use Mleader . (Mleader choice for the user in Multileader Style Manager)

image.png


What I need is mark with a "prefix-number-suffix" (the number is a variable, the prefix is optional and suffix optional) each line or polyline that each block selected in order numerical ascendent. always starting since 1. all that Mleader should be create around blocks selected.


Something like this image:

image.png


0 Likes
1,922 Views
8 Replies
Replies (8)
Message 2 of 9

jtm2020hyo
Collaborator
Collaborator

In simple terms, I need to list the lines that touch the selected blocks in ascending order from 1 to any value. The In simple terms, I need to list the lines that touch the selected blocks in ascending order from 1 to any value. The numbering starts from 1 in each block separately separately.

0 Likes
Message 3 of 9

dbhunia
Advisor
Advisor

Hi

 

I did not get your point exactly.......

 

But what I get, that You want "MLEADER" with incremental numbering .......

 

If so then try this.......

 

(defun c:MLDI (/ NO)
(setq NO (getint "\nEnter Starting Number: "))
(command "ATTDIA" 0)
   (while (setq Point1 (getpoint "\nPick Start Point of MLEADER: "))
	(command "_.MLEADER" Point1 pause NO)
	(setq NO (+ NO 1))
   )
(command "ATTDIA" 1)
(princ)
)

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 4 of 9

3wood
Advisor
Advisor

I am sure there are lots of methods to select all Mleaders touching a polyline.

You can also use SMARTSEL with "CP" option to select all objects touching the polyline.

 

Once all Mleaders selected along a polyline, you can use ALTEXT to change the numbers in ascending sequence along the polyline in 2 steps:

Step 1: Change all Mleader attributes to a "P1S" format. "P" is the prefix, "S" is the suffix, 1 is the initial number.

Step 2: Apply ALTEXT again to previous Mleader selection and use"Along paths" option to change the numbers  along the polyline in a ascending sequence.

Just one thing need to be careful, currently ALTEXT uses location of the block insertion point to determine the sequence, not the leader arrow point. 

 

Some screenshots to explain the settings and results:

1. The initial polyline and Mleaders

altext1.JPG

 

2. ALTEXT settings to change all Mleader attributes to "P1S".

ALTEXT2.JPG

 

3. All Mleaders have the same value "P1S" now.

ALTEXT22.JPG

 

4. ALTEXT settings to Change attributes in sequence "Along paths".

 

ALTEXT4.JPG

 

5. Select the polyline representing the path. A red arrow appears indicating the ascending direction. To start the sequence from the other end of the polyline, select "Reverse" and the red arrow will be lipped and pointing to the opposite direction.

ALTEXT5.JPG

 

6. Final result

ALTEXT6.JPG

 

 

 

 

 

0 Likes
Message 5 of 9

jtm2020hyo
Collaborator
Collaborator

@dbhunia wrote:

Hi

 

I did not get your point exactly.......

 

But what I get, that You want "MLEADER" with incremental numbering .......

 

If so then try this.......

 

(defun c:MLDI (/ NO)
(setq NO (getint "\nEnter Starting Number: "))
(command "ATTDIA" 0)
   (while (setq Point1 (getpoint "\nPick Start Point of MLEADER: "))
	(command "_.MLEADER" Point1 pause NO)
	(setq NO (+ NO 1))
   )
(command "ATTDIA" 1)
(princ)
)

Is not what I was searching for, but useful.

thanks for your help. 

0 Likes
Message 6 of 9

jtm2020hyo
Collaborator
Collaborator

@3wood wrote:

I am sure there are lots of methods to select all Mleaders touching a polyline.

You can also use SMARTSEL with "CP" option to select all objects touching the polyline.

 

Once all Mleaders selected along a polyline, you can use ALTEXT to change the numbers in ascending sequence along the polyline in 2 steps:

Step 1: Change all Mleader attributes to a "P1S" format. "P" is the prefix, "S" is the suffix, 1 is the initial number.

Step 2: Apply ALTEXT again to previous Mleader selection and use"Along paths" option to change the numbers  along the polyline in a ascending sequence.

Just one thing need to be careful, currently ALTEXT uses location of the block insertion point to determine the sequence, not the leader arrow point. 

  

 


 

 

Pretty useful but what I need first before using your code creates the Mleaders.

Sorry because I did not explain correctly my case. Basically, I need a lisp that can create Mleader around 500 blocks that mark touching polylines, lines or arcs, and those Mleader need be numbering incrementally since any number that user choice (default should be 1), I need to create around 15000 Mleaders that mark *lines that are touching selected blocks. I need options like prefix and suffix.

something like this:
post edit:  triangles selected with red represent "selected blocks to create mleader marking polyline around the selected blocks and numbering incrementally"

 


image.png

0 Likes
Message 7 of 9

3wood
Advisor
Advisor

You can try INNB to add Mleaders in a ascending sequence with prefix and suffix manually. You can pick up the Mleader arrowhead when it prompts "Pick up basepoint / <Use text insertion point>:". 

The Mleaders inserted are in same direction but you can drag its grip point to adjust if required.

 

0 Likes
Message 8 of 9

jtm2020hyo
Collaborator
Collaborator

pretty interesting code. If I don't find any solution then I will mark this like "Solution".

@dbhunia@3wood 

thanks for your help to both.

0 Likes
Message 9 of 9

jtm2020hyo
Collaborator
Collaborator

I found a lisp-routine that might help to solve this issue. (first attached)

"slbl2" auto-select blocks that are touching selected polylines. simply that.

0 Likes