Multileader arrowhead coordinates

Multileader arrowhead coordinates

neilyj666
Mentor Mentor
6,974 Views
27 Replies
Message 1 of 28

Multileader arrowhead coordinates

neilyj666
Mentor
Mentor

I have a drawing with many items of multileader text and I want to extract the coordinates of the end of the arrowhead to use as a cogo point. These coordinates don't seem to be available in data extraction so any ideas how I can do this or if I have to manually select each arrow.

 

2020-01-10 15_55_47-Autodesk Civil 3D 2020.jpg

 

Thanks

 

Neil

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Accepted solutions (3)
6,975 Views
27 Replies
Replies (27)
Message 2 of 28

ilia.borisov
Collaborator
Collaborator
Accepted solution

Select similar-> change arrowhead to something with block like "Dot"  or "Dot small" or... -> explode and then data extraction

Message 3 of 28

neilyj666
Mentor
Mentor

My workaround was to 

  1. Explode all the leaders and isolate the arrow heads
  2. Lineworkshrinkwrap all the solids representing the arrow heads to get polyline outlines
  3. Explode all the polylines
  4. Quick select all the shortest lines and delete them
  5. Run a lisp I have that places CAD points at intersections

2020-01-10 16_30_16-Autodesk Civil 3D 2020.jpg

 

A bit clunky but it worked although I'd be keen to hear any other suggestions

 

Neil

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 4 of 28

ilia.borisov
Collaborator
Collaborator
Accepted solution

That work too but I think mine solution is faster

0 Likes
Message 5 of 28

TerryDotson
Mentor
Mentor

It's not available as a FIELD either.  I suppose because there can be multiple arrow (tips) is why.

Message 6 of 28

neilyj666
Mentor
Mentor

@ilia.borisov I would agree - both are valid workarounds but your method is much faster....😊

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 7 of 28

neilyj666
Mentor
Mentor

Probably the reason - luckily for me these were all simple single arrow leaders and changing the style to _DotSmall resulted in block with extractable coordinates

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 8 of 28

cwr-pae
Mentor
Mentor

When I first saw this thread this AM I thought: create a block of a cogo point for the arrow and explode to get the cogo points and insert table to export (using CivilTableExportToCSV from the app store). Testing it showed that exploding the blocks opened the "Duplicate Point Number" dialog for each point block. I can't find a way around the duplicate point number issue, so in addition to a cogo point block, a lisp to automate exploding the blocks is needed. Unfortunately I don't write lisp ;/.

Message 9 of 28

Jeff_M
Consultant
Consultant

@neilyj666 , attached is a small lisp that will place cogo points at the arrowhead location and set the description to the Mleader's Text value. If you don't want the description, just comment that out with ;; at the start of that line of code. If the Mleader has multiple leaders, only the first one in the list of leaders is used.

Jeff_M, also a frequent Swamper
EESignature
Message 10 of 28

jeff_rivers
Advisor
Advisor

This is a neat use of Data Extraction.  I will save this for teaching at the next CAD User's meeting.   


Jeffrey Rivers
Win 10 Pro 64-bit, Intel i9 3.7GHz, 64 GB
NVIDIA RTX A4000
C3D 2020 V13.2.89.0
0 Likes
Message 11 of 28

neilyj666
Mentor
Mentor

Thanks for this @Jeff_M - I'll try it out on Monday

Some of the text describes the watercourse by name and capturing this information was my next problem -  but looks like this lisp will do it for me...:)

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 12 of 28

neilyj666
Mentor
Mentor

@Jeff_M  I've run the code and the points are produced perfectly but there is no description - can you advise??

 

I removed the ;; from the line shown below

 

2020-01-13 08_21_57-C__AutoLisp_PointsFromLeaders_addpointstomleaders.LSP - Notepad++.jpg

 

and the point is created but an error appears in the command line

 

2020-01-13 08_21_40-Autodesk Civil 3D 2020 - [Drawing3.dwg].jpg

 

Please can you advise?

 

Thanks

 

Neil

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 13 of 28

Jeff_M
Consultant
Consultant

@neilyj666 , oops. Looks like I posted the file that was saved before I added the part for the description. Replace that line (#48 in your image) with this:

(vlax-put newpt 'rawdescription (vlax-get ml 'textstring))
;; remove or comment out this line if no description wanted

 

Sorry about that! New file attached.

Jeff_M, also a frequent Swamper
EESignature
Message 14 of 28

neilyj666
Mentor
Mentor

@Jeff_M thanks Jeff this is working great now.....😁

 

Another query about it...if I had a User Defined Property called WatercourseName could the mtext be written to this instead of the Raw Description. I ask because I have a standard Raw Description (WX) and use this in conjunction with the point number to label the watercourses.

 

Thanks

 

Neil

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 15 of 28

Jeff_M
Consultant
Consultant
Accepted solution

@neilyj666 yes, we can write to the UDP. There are a few prerequisites however. You MUST have a PointGroup which has the UserDefinedClassification with the UDP assigned to it. And, the PointGroup must be setup so it will contain the new Point when updated. An easy way to ensure the latter is to just include the "_All Points" group in that group. Failure to have either of these set will result in an Unspecified error when the UDP option is used.

 

I've set it up so you can use either the PointDescription or a UDP for the Mleader's text to be placed into, with the Udp as the default. It will ask you for the name of the UDP each time the lisp is run. Remember that UDP's are case-sensitive. Using your WatercourseName as an example:

Command:
ADDPOINTSTOMLEADERS
Select objects: Specify opposite corner: 1 found
Select objects:
Use Mleader Text in the Point's [Description/Udp]<Udp>:
Name of UDP to use: watercoursename
....error....The UDP with name: watercoursename not found, exiting.
Jeff_M, also a frequent Swamper
EESignature
Message 16 of 28

neilyj666
Mentor
Mentor

@Jeff_M  Many thanks again the code works perfectly...😀

 

2020-01-15 09_02_35-Window.jpg

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 17 of 28

carlFSL33
Explorer
Explorer

Hi @Jeff_M . I've got the same situation where I need to extract the MLeader's coordinates, but my Mleader is attached to a block with attributes. Each block has a unique attribute which I use DATAEXTRACTION afterwards to pull into a spreadsheet, but I'm struggling to get the Mleader's position.

 

Is there a way to add a Block Attribute option to that lisp?

0 Likes
Message 18 of 28

Jeff_M
Consultant
Consultant

@carlFSL33 do you need the CogoPoint created as this lisp does, or just need to find the position Mleader's with that block & attribute?

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 19 of 28

Jeff_M
Consultant
Consultant

Here are a few functions, the first calls the second, and it returns a list of lists for the vertices of all mleaders with blocks having an attribute with the tag name that you pass to the first function. For instance, I have a detail callout as part of an Mleader, that block has the Sheetnumber attribute:

Command: (getmleadervertices "Sheetnumber")
((16870.4 14420.9 0.0 17053.3 14703.2 0.0 17252.7 14753.1 0.0) (16882.6 14446.5 0.0 17065.4 14728.9 0.0 17264.9 14778.7 0.0) (16906.5 14468.9 0.0 17089.4 14751.3 0.0 17288.8 14801.1 0.0) (16917.7 14483.5 0.0 17100.6 14765.8 0.0 17300.0 14815.7 0.0))

The first 3 entries in each list will be the arrowhead location.

(defun getmleadervertices
       (attname / idx ent ss ml atts vertices vertslist)
  (setq ss (ssget "X" '((0 . "MULTILEADER"))))
  (setq attname (strcase attname))
  (setq idx -1)
  (while (setq ent (ssname ss (setq idx (1+ idx))))
    (setq ml (vlax-ename->vla-object ent))
    (if	(and (= 1 (vlax-get ml 'contenttype))
	     (setq atts (getmleaderatts ml))
	     (assoc attname atts)
	)
      (progn
	(setq vertices (vlax-invoke ml 'getleaderlinevertices 0))
	;;get only the vertices of the first leader line
	(if vertslist
	  (setq vertslist (cons vertices vertslist  ))
	  (setq vertslist (list vertices))
	)
      )
    )
  )
  vertslist
)

;;Found function on the Swamp, posted by Lee Mac in 2014
(defun getmleaderatts (obj / rtn)
  (if
    (and
      (= "AcDbMLeader" (vla-get-objectname obj))
      (= acblockcontent (vla-get-contenttype obj))
    )
     (vlax-for sub
		   (vla-item
		     (vla-get-blocks (vla-get-document obj))
		     (vla-get-contentblockname obj)
		   )
       (if (= "AcDbAttributeDefinition" (vla-get-objectname sub))
	 (setq rtn
		(cons
		  (cons
		    (strcase (vla-get-tagstring sub))
		    (vla-getblockattributevalue obj (vla-get-objectid sub))
		  )
		  rtn
		)
	 )
       )
     )
  )
  (reverse rtn)
)
Jeff_M, also a frequent Swamper
EESignature
Message 20 of 28

carlFSL33
Explorer
Explorer

Morning @Jeff_M ,

 

Thank you so much for the reply and hope you and those close to you are doing well in this difficult time.

 

I'm not so clued up on the lisps but know how they work so I'll work through your answer. I'm attaching 3 images;

 

1.jpg) What it looks like on the drawing. It's an Mleader with a block (Multileader type: block). The red dot is the position I'm interested in, which is the Mleader's tip.

 

2.jpg) What my block looks like in Block Editor.

 

3.jpg) What the spreadsheet looks like after DATAEXTRACTION - I've edited the spreadsheet to what it must look like in its final form - the YX-position needs to be added.

 

If a Cogo Point can be added to that YX-position and given the name of the SWNU value, i.e. SW59 in this case, that would be great. Also note that some of these blocks have more than one MLeader but I'm only interested in the first one's position (you mentioned something like this in a previous post)

 

Hope this answer your question and thank you for the assistance.

0 Likes