Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to dimension between two points in a selection set?

1 REPLY 1
Reply
Message 1 of 2
bennywise578
377 Views, 1 Reply

How to dimension between two points in a selection set?

Looking to make a selection set of points that are on a specific layer, and then create a dimension between, in this case, two points. I feel like it should be very simple, but I can't get it to work for the life of me. Here is the test code I've been playing around with:

 

(defun c:test (/ sel1 TC)

(setq sel1 (ssget "X" '((8 . "VPOINTS"))))

(setq TC (polar (entget (assoc 10 (ssname sel1 0))) (dtr 180.0) 9))
(command "DIMLINEAR" (entget (assoc 10 (ssname sel1 0))) (entget (assoc 10 (ssname sel1 1))) "V" (polar TC (dtr 180.0) 9) "")

)
(defun dtr (x)
;define degrees to radians function

(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI

) ;end of function

 

 

Any help would be greatly appreciated. Thanks.

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: bennywise578

[Posting the same question on two threads isn't a good idea, not least because someone who finds one of them later, looking for an answer to a similar question, will have no way of knowing that it was answered on another thread.]

 

See my reply to your other thread.  I think you would be well served by spending some time looking over the entries in the AutoLISP Reference for the various functions involved, and becoming more familiar with the kinds of information they want as arguments, and the kinds of information they return.  What you have is trying to apply various functions to various things to which they are not applicable.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost