Lisp routine outdated, please help!

Lisp routine outdated, please help!

newby2
Participant Participant
399 Views
5 Replies
Message 1 of 6

Lisp routine outdated, please help!

newby2
Participant
Participant

This routine works up until the point where it needs to insert the attrubutes then it bombs out.

This worked with AutoCAD 2009 but not with 2021.

 

For example...

 

Command: (LOAD "K:/HSMOD2006/LISP/RADSTAIR") C:RADSTAIR
Command: radstair
H. Software Systems, Inc. curved stair template
Enter spiral up to (L)eft or (R)ight: l
Enter Flanges (I)n or (O)ut: o
Enter stair plan radius: 41'9-15/16
Enter stair plan chord length (0 if angle based): 0
Enter stair angular sweep (deg): 19.27
Enter the stair rise: 1'0-1/8
(501.938 168.02 0.336325 12.125 7.08034 168.814 168.457 7.08034 504.533 169.249)insert Enter block name or [?] <dsheet>: K:\hsmod2006\lisp\ewfOL
Units: Unitless Conversion: 0'-1"
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate/Explode/REpeat]: 0,0
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>: Enter Y scale factor <use X scale factor>:
Specify rotation angle <0.0000>: 0
Command: insert Enter block name or [?] <ewfOL>: K:\hsmod2006\lisp\tempLT
Units: Unitless Conversion: 0'-1"
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate/Explode/REpeat]: 0,0
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>: Enter Y scale factor <use X scale factor>:
Specify rotation angle <0.0000>: 0
Command: 41'-9 15/16" Unknown command "41'-9 15/16"". Press F1 for help.
Command: 14'-0" Unknown command "14'-0"". Press F1 for help.
Command: 19.2700%%d Unknown command "2700%D". Press F1 for help.
Command: 1'-0 1/8" Unknown command "1'-0 1/8"". Press F1 for help.
Command: 7 1/16" Unknown command "7 1/16"". Press F1 for help.
Command: 14'-0 13/16" Unknown command "14'-0 13/16"". Press F1 for help.
Command: 14'-0 7/16" Unknown command "14'-0 7/16"". Press F1 for help.
Command: 7 1/16" Unknown command "7 1/16"". Press F1 for help.
Command: 42'-0 9/16" Unknown command "42'-0 9/16"". Press F1 for help.
Command: 14'-1 1/4" Unknown command "14'-1 1/4"". Press F1 for help.
Command: RADSTAIR
Unknown command "RADSTAIR". Press F1 for help.
Command: RADSTAIR
Unknown command "RADSTAIR". Press F1 for help.
Command: 42'-0 9/16" Unknown command "42'-0 9/16"". Press F1 for help.
Command: 1'-0 1/8" Unknown command "1'-0 1/8"". Press F1 for help.
Command: 14'-0 13/16" Unknown command "14'-0 13/16"". Press F1 for help.
Command: 14'-1 1/4" Unknown command "14'-1 1/4"". Press F1 for help.
Command: zoom
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: e

 

Any advice would be appreciated, thanks.

0 Likes
Accepted solutions (1)
400 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend
Can you share the required block files tempLT and ewfOL please
0 Likes
Message 3 of 6

newby2
Participant
Participant

see attached

0 Likes
Message 4 of 6

paullimapa
Mentor
Mentor
Accepted solution

worked for me after I added these attribute settings to the drawTemplate function:

(defun drawTemplate (stairParams / attreq attdia) ; localize variables
	(princ stairParams)
;;; add to save current settings
        (setq attreq (getvar"attreq") attdia (getvar"attdia"))
;;; add to set attribute prompt and dialog settings
        (setvar "attreq" 1) 
        (setvar "attdia" 0)
;;;
; Insert the template & set attributes accordingly
	(command "insert" (strcat templatePath flgfile) "0,0" "" "" 0)
	(command "insert" (strcat templatePath templateFile) "0,0" "" "" 0
		(rtos (nth 0 stairParams) 4 archPrec)  ; planRad
		(rtos (nth 1 stairParams) 4 archPrec)  ; planChord
		(strcat (angtos (nth 2 stairParams) 0 angPrec) "%%d"); planSweep
		(rtos (nth 3 stairParams) 4 archPrec)  ; rise
		(rtos (nth 4 stairParams) 4 archPrec)  ; plaMo
		(rtos (nth 5 stairParams) 4 archPrec)  ; planArcLength
		(rtos (nth 6 stairParams) 4 archPrec)  ; trueChord
		(rtos (nth 7 stairParams) 4 archPrec)  ; trueMo
		(rtos (nth 8 stairParams) 4 archPrec)  ; trueRollingRadius
		(rtos (nth 9 stairParams) 4 archPrec)  ; trueSlope
		""					; Project
		""					; Description
		(rtos (nth 8 stairParams) 4 archPrec)  ; trueRollingRadius
		(rtos (nth 3 stairParams) 4 archPrec)  ; rise
		(rtos (nth 5 stairParams) 4 archPrec)  ; run
		(rtos (nth 9 stairParams) 4 archPrec)  ; slope
	)

	; Zoom extents
	(command "zoom" "e")
;;; add to restore original settings
        (setvar "attreq" attreq)
        (setvar "attdia" attdia)
;;;
)

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 6

newby2
Participant
Participant

Perfect, Thank you!

0 Likes
Message 6 of 6

paullimapa
Mentor
Mentor

Glad to have helped…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes