Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Autolisp Lesson part 2 2

Status
Not open for further replies.

shadow

Computer
Mar 1, 2001
321
tigrek
ok here is what i have done since yesterday
From

;11 calculate line length in drawing units
(setq linelength (sqrt (+
(expt (- (car starting)(car ending)) 2)
(expt (- (cadr starting)(cadr ending)) 2)
;(expt (- (cddr starting)(cddr ending)) 2)
)))
To

;11 calculate line length in drawing units
(setq linelength (Distance starting ending))

And this works but i still cannot figure out how to make this calc more accurately
give me a hint please :)

Also i have a question about this here

;12 estimate the midpoint coordinates
(setq midpoint (polar starting angleradian (/ linelength 2)))
;lets put text a textsize away from the line
;replace textheight in the following line with other distances, if you wish,
(setq distfromline textheight)
(setq midpoint (polar midpoint (+ angleradian (/ 22. 14)) distfromline))

you have midpoint setqed 2 times althought vlide shows no error i dont undestand it very well
also you have there distfromline setqed from textheight but why ?? its not used anwhere else in the routine otehr than in the second midpoint setq in the routine

let me know but i would really like to figure out why i cannot get anything better than 1/4" precision when labeling
if everyone helps everybody the world will be a better place
 
Replies continue below

Recommended for you

tigrek found this thought you could use it

"Issue

Dialog boxes can be one of two types: Microsoft Foundation Classes (MFC) or Proteus. You want to know which dialog boxes are affected by the CMDDIA system variable and which you can change by modifying the base.dcl file.



Solution

MFC dialogs can be identified by a small question mark (?) in the upper-right corner of the dialog box, as shown in the following figure:



MFC dialogs are not affected by the CMDDIA system variable.

Proteus dialog boxes are defined in the base.dcl file and do not contain a question mark.

Note: Windows, such as those in AutoCAD® DesignCenterTM are not considered dialog boxes. They are actually separate windows, which is the reason you do not see a question mark in the window." if everyone helps everybody the world will be a better place
 
Unfortunately pure lisp cannot read the clipboard information. If you incorporate the ActiveX components of VisualLisp it may be possible to construct such a program, however with the right click cut/paste ability already in windows, one might question why it would be necessary, not that it wouldn't be useful, it just seems like since Lisp cannot export outside of a cad environment, other programming languages would be needed such as VB, and if you did the base program in VB you wouldn't really need to do part of it in lisp. If anyone would like to sign up for a lisp tutorial, send your email to:

lisptutorial@bcinc.hypermart.net

The tutorial will have answers to subscriber questions as well as sample code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor