大家好,
我想修改我的lisp。我不知道怎么做,我需要一些帮助。
我的代码按距离和方位角绘制直线。这是一个很棒的代码,但可以更好。
我想调用命令,顺时针绘制多边形,只需放置距离和方位角。
这段代码的问题是每次调用代码时,我都必须选择一个拾取点。
任何帮助都将是巨大的!
提前感谢
- ;;;---------------------------------------------
- ;;; Rotina para desenhar uma linha com o ângulo
- ;;;---------------------------------------------
- ;;; Autolisp Rogério 09/12/04
- (defun C:AZI ()
- (setvar "cmdecho" 0)
- ;(setq PT1 (getpoint "Pick o ponto de início: "))
- (setq DISTANCIA (getstring "\nDistância: "))
- (setq CPTO (STRCAT "@" DISTANCIA "<"))
- (setq GRAUS (getstring "\nÂngulo: "))
- (setq MINUTOS (getstring "\nMinutos: "))
- (setq SEGUNDOS (getstring "\nSegundos: "))
- (setq ANG (STRCAT GRAUS "d" MINUTOS "'" SEGUNDOS """))
- (princ "\nAzimute: ")
- (PRINC CPTO)
- (PRINC ANG)
- (setq LINHA (STRCAT CPTO ANG))
- (prompt "\nPick o ponto de início:")
- ;;(command "Poliline" pause CPTO ANG "")
- (command "PLINE" pause LINHA "")
- (command "units" 2 2 2 4 270 N "insunits" 0);;Decimal=2/ N°Casas=2/ Sistema Angulo=2/ Fração Angulo=4/ Direção Angulo=0/ Relógio=N
- (setvar "cmdecho" 0)
- (PRINC)
- )
- (Princ "\nDigite AZ para iniciar.")
- (Princ)
- ;EXPLICAÇÃO: by Marcio
- ;================
- ;Command: -UNITS
- ;================
- ; 1. Scientific 1.55E+01
- ; 2. Decimal 15.50
- ; 3. Engineering 1'-3.50"
- ; 4. Architectural 1'-3 1/2"
- ; 5. Fractional 15 1/2
- ;With the exception of Engineering and Architectural formats,
- ;these formats can be used with any basic unit of measurement.
- ;For example, Decimal mode is perfect for metric units as well
- ;as decimal English units.
- ;Enter choice, 1 to 5 <2>:
- ;--------------------------------------------------------------
- ;Enter number of digits to right of decimal point (0 to Cool <2>:
- ;--------------------------------------------------------------
- ;Systems of angle measure: (Examples)
- ; 1. Decimal degrees 45.0000
- ; 2. Degrees/minutes/seconds 45d0'0"
- ; 3. Grads 50.0000g
- ; 4. Radians 0.7854r
- ; 5. Surveyor's units N 45d0'0" E
- ;Enter choice, 1 to 5 <2>:
- ;-------------------------------------------------------------- --------
- ;Enter number of fractional places for display of angles (0 to Cool <4>:
- ;-------------------------------------------------------------- --------
- ;Direction for angle 0d0'0":
- ; East 3 o'clock = 0d0'0"
- ; North 12 o'clock = 90d0'0"
- ; West 9 o'clock = 180d0'0"
- ; South 6 o'clock = 270d0'0"
- ;Enter direction for angle 0d0'0" <0d0'0">:
- ;-------------------------------------------
- ;Measure angles clockwise? [Yes/No] <N>
- ;-------------------------------------------
- ;================ ==
- ;Command: INSUNITS
- ;==================
- ;Enter new value for INSUNITS <0>:
- ;0 Unspecified (No units) = unitless
- ;1 Inches
|