Jump to content

What does this command mean?


Cadastrophic

Recommended Posts

I tried using this lisp which inserts A-A section arrows. The last command in the string confuses me; "enter first section callout:"

Can anyone please explain what I should be doing at this command?

 

SECT.LSP Section Arrows

 

(defun C:SECT ()

(setvar "fillmode" 1)

(setvar "mirrtext" 0)

(setq CHDIMSCL "N")

(setq CHDIMTXT "N")

(setq OP1 (getstring

"\n draw section cut (H)orizontal or (V)ertical "

) ;_ end of getstring

) ;_ end of setq

(setq OP1 (strcase OP1))

 

(if (= OP1 "V")

(progn

(setq OP (getstring "\n draw arrows (L)eft or ®ight "))

(setq OP (strcase OP))

) ;_ end of progn

) ;_ end of if

(if (= OP1 "H")

(progn

(setq OP (getstring "\n draw arrows (U)up or (D)own "))

(setq OP (strcase OP))

) ;_ end of progn

) ;_ end of if

 

(setq PTS (getpoint "\n pick first arrow starting point"))

(setq P PTS)

(setq PTS2 (getpoint "\n pick second arrow starting point"))

(setq COUT1 (getstring "\n enter first sect callout: "))

(if (= COUT1 "")

(setq COUT1 "A")

) ;_ end of if

(setq P2 PTS2)

(setq COUT1 (strcase COUT1))

 

(setq COUT2 (getstring "\n enter second sect callout: "))

(if (= COUT2 "")

(setq COUT2 "A")

) ;_ end of if

(setq COUT2 (strcase COUT2))

 

 

 

;DIMSCALE

 

(setq SCAL (getvar "dimscale"))

(if (= SCAL NILL)

(setq SCAL DEFSCAL)

) ;_ end of if

(princ "\n DIMSCALE is set to

(princ SCAL)

 

(princ ">; Change DIMSCALE Y/N

(princ CHDIMSCL)

(setq CHDIMSCL (getstring ">: "))

(setq CHDIMSCL (strcase CHDIMSCL))

 

(if (= CHDIMSCL "Y")

(progn

(princ "\ Enter new DIMSCALE setting

(setq DIMSCL (getreal ">: "))

(setvar "dimscale" DIMSCL)

(setq SCAL (getvar "dimscale"))

) ;_ end of progn

) ;_ end of if

 

 

(setq SCL (* 1.0 SCAL))

 

(setq PTY (cadr PTS))

(setq PTX (car PTS))

 

(setq PT2Y (cadr PTS2))

(setq PT2X (car PTS2))

 

(if (= OP1 "H")

(progn

(if (

(progn

(setq PTS P2)

(setq PTS2 P)

) ;_ end of PROGN

) ;_ end of IF

) ;_ end of progn

) ;_ end of if

(if (= OP1 "V")

(progn

(if (> PTY PT2Y)

(progn

(setq PTS P2)

(setq PTS2 P)

) ;_ end of PROGN

) ;_ end of IF

) ;_ end of progn

) ;_ end of if

 

(setq PTY (cadr PTS)) ;y coor starting point

(setq PTX (car PTS)) ;x coor starting point

 

(setq PT2Y (cadr PTS2))

(setq PT2X (car PTS2))

 

 

(if (= OP1 "V")

(setq MID (/ (- PT2Y PTY) 2))

) ;_ end of if

(if (= OP1 "H")

(setq MID (/ (- PT2X PTX) 2))

) ;_ end of if

(setq TXTSZ (* SCL 0.25))

(setq SF (* SCL 0.375))

 

(if (= OP1 "V")

(progn

(setq MIRRY1 (list PTX (+ PTY MID)))

(setq MIRRY2 (list (+ PTX 1.0) (+ PTY MID)))

) ;_ end of progn

) ;_ end of if

 

(if (= OP1 "H")

(progn

(setq MIRRY1 (list (+ PTX MID) PTY))

(setq MIRRY2 (list (+ PTX MID) (+ PTY 1.0)))

) ;_ end of progn

) ;_ end of if

 

(setq LTAIL (- PTX SF)) ;tail length

 

(setq TAIL (list LTAIL PTY)) ;end point of tail

 

(setq TAILX (car TAIL))

(setq TAILY (cadr TAIL))

 

(setq LARR (- TAILX SF)) ;length of arrow

(setq ARR (list LARR TAILY 0)) ;arrow end point

 

(setq ARRY (cadr ARR)) ;y coord at end point of arrow

(setq ARRX (car ARR)) ;x coord at end point of arrow

 

(setq TLOC (- ARRX SF))

(setq TLOC (+ TLOC 0.25))

(setq TLOCP (list TLOC ARRY)) ;ver text location

 

(if (= OP "U")

(progn

(setq TLOC (+ PTY SF SF SF))

(setq TLOCP (list (+ PTX (/ SF 5.5)) TLOC)) ;hor text location

) ;_ end of progn

) ;_ end of if

 

(if (= OP "D")

(progn

(setq TLOC (- PTY SF SF SF))

(setq TLOCP (list (+ PTX (/ SF 5.5)) TLOC)) ;hor text location

) ;_ end of progn

) ;_ end of if

 

 

(setq SF1 (* SCL 0.3375))

(setq TAILY (cadr TAIL)) ;y coor at end point of tail

(setq TAILX (car TAIL)) ;x coor at end point of tail

 

(if (

(setq VLTAIL (+ TAILY SF))

) ;_ end of if

(if (> PTY PT2Y)

(setq VLTAIL (- TAILY SF))

) ;_ end of if

 

(setq LTAILX (+ TAILX SF1))

 

(if (= OP "D")

(setq VLTAIL (- TAILY SF))

) ;_ end of if

(if (= OP "U")

(setq VLTAIL (+ TAILY SF))

) ;_ end of if

 

(setq VTAILX (list LTAILX TAILY))

(setq VTAIL (list LTAILX VLTAIL))

 

(setq W1 (* (/ 1.875 10.0) SCL))

(setq W2 (* (/ 0.75 10.0) SCL))

 

(command "pline" TAIL "w" W1 0 ARR "") ;arrow

(if (= OP "U")

(command "rotate" "l" "" VTAILX -90 "")

) ;_ end of if

(if (= OP "D")

(command "rotate" "l" "" VTAILX 90 "")

) ;_ end of if

 

(if (= OP "L")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

(if (= OP1 "H")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

 

(if (= OP "R")

(progn

(command "mirror" "l" "" VTAILX VTAIL "y")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of progn

) ;_ end of if

 

(command "pline" PTS "w" W2 W2 TAIL "") ;horz tail

 

(if (= OP "L")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

(if (= OP1 "H")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

 

(if (= OP "R")

(progn

(command "mirror" "l" "" VTAILX VTAIL "y")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of progn

) ;_ end of if

 

(command "pline" VTAILX "w" W2 W2 VTAIL "")

(if (= OP "L")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

(if (= OP1 "H")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of if

 

(if (= OP "R")

(progn

(command "mirror" "l" "" VTAILX VTAIL "y")

(command "mirror" "l" "" MIRRY1 MIRRY2 "n")

) ;_ end of progn

) ;_ end of if

(if (/= COUT1 "")

(progn

(command "text" "j" "mr" TLOCP TXTSZ "" COUT1)

(command "mirror" "l" "" MIRRY1 MIRRY2 "Y")

(if (= OP "R")

(command "mirror" "l" "" VTAILX VTAIL "y")

) ;_ end of if

 

(command "text" "j" "mr" TLOCP TXTSZ "" COUT2)

(if (= OP "R")

(command "mirror" "l" "" VTAILX VTAIL "y")

) ;_ end of if

) ;_ end of progn

) ;_ end of if

(setvar "plinewid" 0)

(redraw)

(princ)

) ;_ end of defun

 

(princ " loaded.. start command with SECT")

Link to comment
Share on other sites

The first and second callouts are the 2 text items that will get placed next to the section arrow tips. For example "A" and "A" for first and second callouts.

Link to comment
Share on other sites

I thought that's what it meant, but when I entered A and then A again, nothing appeared to happen.

Then since first posting, I had another go at it, and realised I hadn't altered the dimscale (to 10).

BUT, when I did ammend the dimscale only one A appeared and it has a very ugly thick arrow (presumably upsized when I changed the dimscale to 10).

Is there something else I'm missing?

Can the second arrow be made to appear (or do I just copy the existing one)?

Can the arrow be made to remain at the default line scale with just the letter A configurable?

Thanks for your input.

Link to comment
Share on other sites

I believe the thick arrow is how it was designed to work. It mae both arrows for me. If your current style text height isn't 0.0 it doesn't wok right - that might explain the single arrow result.

 

The routine can be tweaked to allow the arrow size to be customized. Find the code which draws the arrows and lines (or the lines that define the widths W1 & W2) and modify those. The following lines draw the lines/arrows.:

 

(command "pline" TAIL "w" W1 0 ARR "") ;arrow

(command "pline" PTS "w" W2 W2 TAIL "") ;horz tail

(command "pline" VTAILX "w" W2 W2 VTAIL "")

 

Following lines set the widths:

 

(setq W1 (* (/ 1.875 10.0) SCL))

(setq W2 (* (/ 0.75 10.0) SCL))

 

 

You might experiment with the 10.0 factor in those 2 lines.

Link to comment
Share on other sites

  • 3 years later...

I am creating 2-D Orthographic drawings of mechanical parts (not architectural, not solids) and am trying to find how to add the Cutting Plane, Arrows and Label in one view to define a Section View. All I have found in this Forum are: 3D Cutting Planes, directions to somehow construct a custom arrow, and Lisp programs (whatever that is). Am I searching the wrong phrase? :? You know, the heavy cutting plane line (perhaps rotated or offset), with directional arrows, labeled A-A and a Section View, Hatched, labeled Section A-A? How do I insert the Cutting Plane, Arrows and Labels? Do I need to construct each element in every view? Jeez, Mon. There isn't a Section Tool, Symbol or Block available? This is per ANSI, not anything unusual.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...