Can't get the "AddDimRadial" method to work

Can't get the "AddDimRadial" method to work

Anonymous
Not applicable
908 Views
3 Replies
Message 1 of 4

Can't get the "AddDimRadial" method to work

Anonymous
Not applicable

Hi all,

 

I am trying to modify the DMP lisp which I found here (also attached). I need to replace AddDim3PointAngular method with AddDimRadial method at line no. 203 of the code. 

 

In brief the DMP lisp add dimension to plines with a single click which is really cool. But the code has been written in a way to add arc length whereas I would like to have arc radius instead. 

 

So this is what the code does at the moment:

 

1.png

 

And this is what I need:

 

2.png

 

 

The error I get is:

 

 

Error: lisp value has no coercion to VARIANT with this type:  #<variant 8197 ...>

 

Can someone help me with the correct syntax?

0 Likes
Accepted solutions (1)
909 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

It's difficult to do the task with your current code. Because it allows to select only Polylines. And retrieving radius of Polyline arc is not possible as far as I know. Here I have attached a separate code for ARC.

 

(defun c:adm ()
(vl-load-com)

(defun *error* (msg)
 (princ msg)
 (princ) 
);defun error


(setq ss (ssget "_:S:E:L" '((0 . "ARC"))))
(setq obj (ssname ss 0)
      obj1 (vlax-ename->vla-object obj)
      cen (vla-get-center obj1)
      al (vla-get-arclength obj1)
      cp (vlax-3d-point (vlax-curve-getPointatDist obj1 (/ al 2))))


(vla-addDimRadial (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) cen cp 5)
     

);defun

 

 

STM

0 Likes
Message 3 of 4

Anonymous
Not applicable
hmm... Never thought that way. Thanks for enlightening.
0 Likes
Message 4 of 4

joselggalan
Advocate
Advocate
Accepted solution

Con permiso de autor del programa.

Updated file attached

 

Remove and add code:

 

                       ;;Code Removed:
		      
			;;;(setq dm (vla-adddim3pointangular
			;;;	 acsp
			;;;	 (vlax-3d-point cen)
			;;;	 (vlax-3d-point y)
			;;;	 (vlax-3d-point z)
			;;;	 (vlax-3d-point txp)
			;;;       )
			;;;)
			;;;(vla-put-textoverride
			;;;dm
			;;;(rtos (abs (- (vlax-curve-getdistatpoint pl y)
			;;;	      (vlax-curve-getdistatpoint pl z)
			;;;	   )
			;;;      )
			;;;      2
			;;;      2
			;;;)
			;;;)
		      
		      ;;Code new:
		      (setq dm (vla-AddDimRadial
				 acsp
				 (vlax-3d-point cen)
				 (vlax-3d-point mid)
				 0.0
			       )
		      )

 

 

 

0 Likes