Need to multiply result by 12

Need to multiply result by 12

SurveyorJeff
Participant Participant
900 Views
3 Replies
Message 1 of 4

Need to multiply result by 12

SurveyorJeff
Participant
Participant

I need some help with the following routine. Been so long since I have done any lisping I don't know how to do this.

 

I work in decimal units and I have this routine that will change a selected text to a distance label in decimal format. I often work with contractors that work in feet and inches. We have architectural plans sometimes in where the dimensions don't mathematically add up or "close" and we need to get a dimensioned plan that does close. I am usually left in charge of this. I want to be able to show both decimal distances as well as architectural distances on one plan.

 

I was just going to change the lisp below but can't figure it out. What I need to do is multiply the distance stored in "b" by 12 and stored as a new value. Any help would be greatly appreciated. 

 

or

 

I've tried creating a label style in C3D but can't get that figured out either. Working in decimal and wanting architecture isn't working so well for me and my limited customization skills. I will take anything that someone can throw my way. What would be awesome is a C3D label style that would give me decimal distance above the selected line with a architectural distance above that?

 

I can't figure it out.

 

Thanks for your help. This will make life for all of us on this next project much better.

 

 

(defun c:dch (/ a b c d e f g)
(setq a (getpoint "Select first point ")) (terpri)
(setq b (getdist a "Select second pt ")) (terpri)
(setq c (strcat (rtos b 4)))
(setq d (entget (car (entsel)))) (terpri)
(setq e (assoc 1 d))
(setq f (cons (car e) c))
(setq g (subst f e d))
(entmod g))

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

dlanorh
Advisor
Advisor
Accepted solution

I don't know what your "decimal" units are but i'm assuming feet. Try the following

 

(defun c:dch (/ a b c d e f g)
(setq a (getpoint "\nSelect first point "))
(setq b (* (getdist a "\nSelect second pt ") 12))
(setq c (rtos b 4))
(setq d (entget (car (entsel "\n"))));what are you selecting here?
(entmod (subst (cons 1 c) (assoc 1 d) d))

I am not one of the robots you're looking for

0 Likes
Message 3 of 4

SurveyorJeff
Participant
Participant

Thanks for this. That was way too easy. Geeze you don't write any programs for 15 years and forget how to do the simplest things.

 

To answer your question, I pick a piece of text to edit.

0 Likes
Message 4 of 4

dlanorh
Advisor
Advisor
No problem. I asked because dimensions should be handled slightly differently

I am not one of the robots you're looking for

0 Likes