Jump to content

Recommended Posts

Posted

Hi everyone

 

I'm trying to create a mleader to properly label the properties of some Plant 3D components, but i'm having some problems to set elevation of the mleader, given that mleader don't have an "elevation" Property to use vla-put. So far i tried with (trans p1 0 1) (trans p2 0 1) but everything ends up in the correct x and y coordinates but in z 0 

 

(defun mleader (text)
  

	(if
		(and
			(setq p1 (getpoint "\nPick First Point: "))
			(setq p2 (getpoint "\nPick Next Point: " p1))
		)
	  
		(progn
			(setq obj
				(vlax-invoke
					(vlax-get (vla-get-ActiveDocument (vlax-get-acad-object))
						(if (= 1 (getvar 'CVPORT))
							'PaperSpace
							'ModelSpace
						);if
					);end of vlax
				'AddMLeader
				(append p1 p2)	
				0
				);end invoke
			);end setq obj
			(vla-put-textstring obj text)
		  	(vla-put-TextHeight obj 50)
		  	(vla-put-TextWidth obj 1300)		  
		);end of progn
			    
	);end if

(princ)  
);end defun mleader

 

I'm looking forward to read the comments about this regard. i'm sure it will be really useful 

 

BTW, does anyone know why 'AddMleader after (append p1 p2) needs this extra 0 ???? 

 

Thanks a lot 

 

 

 

Posted
2 hours ago, Herr_Manu said:

Hi everyone

 

BTW, does anyone know why 'AddMleader after (append p1 p2) needs this extra 0 ???? 

 

 

 

 

It's the leader index since an mleader can have multiple leaders.

  • Like 2
Posted (edited)

Removed misread post.

Edited by BIGAL

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