Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
bennywise578
Posts: 32
Registered: ‎10-27-2011
Message 1 of 2 (101 Views)

How to dimension between two points in a selection set?

101 Views, 1 Replies
11-01-2011 01:36 PM

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.

*Expert Elite*
Kent1Cooper
Posts: 5,268
Registered: ‎09-13-2004
Message 2 of 2 (95 Views)

Re: How to dimension between two points in a selection set?

11-01-2011 01:55 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community