ShadowMountain Posted December 17, 2016 Share Posted December 17, 2016 ;Program Glitches, and then to add ;Computation features. ; program Algorithm ; Program to utilize one line, offset to height, ; then define a 3dface at beam element endpoint, ; while adding a second beam element at 3dface header. ; define xy plane to offset wall thickness ;;INITGET ;Table 4.1: The Initget bit codes and what they mean; ;CODE MEANING ;1 null input not allowed ;2 zero values not allowed ;4 negative values not allowed ;8 do not check limits for point values ;16 return 3D point rather than 2D point ;32 Use dashed lines for rubber-banding lines and windows ;Table 4.2: The Bit codes and related Get functions ;FUNCTION can be used with initget bit code: ;getint 1,2,4 ;getreal 1,2,4 ;getdist 1,2,4,16,32 ;getangle 1,2,32 ;getorient 1,2,32 ;getpoint 1,8,16,32 ;getcorner 1,8,16,32 ;getkword 1 ;getstring no initget codes honored ;;****** (defun getinfo () (initget 17) (setq pt1 (getpoint "For 3DFace & Beam set,Pick first corner:")) ; pt1 gtpt & pt4 gtpt together result nil to pt1 (setq pt4 (getpoint "Select endpoint at wall floor, coord D of ABCD:")) (initget 7) (setq hz (getreal "Set h (per unit):")) ) ;(defun procinfo () ; (setq pt2 (list (car pt1) (cadr pt1) (+ (caddr pt1) hz))) ; (setq pt3 (list (car pt4) (cadr pt4) (+ (caddr pt4) hz))) (defun output () ;princ( rtos[".x" pt1][4] , rtos[".y" pt1][4] , rtos[".z" pt1][4] ) to consider ;princ( rtos[".x" pt4][4] , rtos[".y" pt4][4] , rtos[".z" pt4][4] ) to print coordinates in ft - inches !pt1 ;!pt2 !pt4 !hz ;!pt3 (command "pline" pt1 pt4 "c") ;(command "pline" pt2 pt3 "c") ;(command "3dface" pt1 pt2 pt3 pt4 "c") (command "pline" ".xy" pt1 hz ".xy" pt4 hz "c") (command "3dface"pt1 ".xy" pt1 hz ".xy" pt4 hz pt4 "\e") ) (defun C:SOPA (/ pt1 pt4 hz ) (getinfo) ; (procinfo) (output) ) ; (rtos [real or integer value][unit style code][precision]) ; The first argument to rtos is the number being converted. ; It can be a real or integer. The next argument is the unit ; style code. Table shows a listing of these codes and their meaning. ;Code Format ;1 Scientific ;2 Decimal ;3 Feet and decimal inches ;4 Feet and inches ;5 Fractional units ; Ouput coordinate assume 3dface expanded in UCS Z ; Wall boundary exterior and width at endpoint demarcate ; beam element boundaries to create 3dface element. ; ; ; Elements are stored in Dxf format. ;| inline comment |; ; Object pline , Object 3dface ; Select centerline method or exterior wall and width ; [verify units] ; ; specify insertion point ; ( command "3dface" pt1 pt4 ".xy" pt4 hz ".xy" pt1 hz pt2 ;pt3 "" "3dface" pt1 pt2 ".xy" pt1 hz pt1 "" "copy" "L" "" ;pt1 pt4) ; ; ; ; ; ;(initget 17) ;(setq pt1 (getpoint "Pick first corner")) ;(setq pt4 (getpoint "Select line endpoint, coord D of ABCD")) ;(setq hz (getreal "Set h")) ;(setq pt2 (list (car pt1) (cadr pt1) (+ (caddr pt1) hz))) ;(setq pt3 (list (car pt4) (cadr pt4) (+ (caddr pt4) hz))) ;(command "line" pt1 pt4) ;(command "line" pt2 pt3) ;(command "3dface" pt1 pt2 pt3 pt4) ;|AutoLISP control characters Code Description \\ \ character \" " character \e Escape character \n Newline character \r Return character \t Tab character \nnn Character whose octal code is nnn |; Apt002.dwg Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 18, 2016 Share Posted December 18, 2016 Please read this: http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines And please describe your problem in more detail. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.