ventanas dibujadas con ve.bsc |
'Dibuja estomáticamente una ventana en planta, recorta el muro y dibuja el vierteaguas empotrado
'el programa solicita al usuario la anchura de la ventana y el numero de hojas.
'el dibujo generado es mínimo pero suficiéntemente expresivo.
'el código esta generado en BasiCad y se lee diréctamente con DesignCad
'se repite la operación hasta que se desea terminar pulsando la tecla f
a2:input "Ancho del muro (cm) " m
tt=1
if m=0 then end
m=m/100
if m<0.1 then m=0.1
input "Ancho de ventana (cm) " a
a=a/100
input "Numero de hojas " j
a1:
setpoint "Sitúe 2 puntos: 1) Centro cara interior 2) Dirección exterior" 2
if sys(1)<>2 then goto a1
pointval x1 y1 1
pointval x2 y2 2
> undo
>undo
if x2=x1 then
>movexy [x1][y1]
if y2>y1 then v=1
if y2
>pr [-a/2][v*0.05]
>pr [a][v*m]
>secdelc
>pr [0][v*(-0.05)]
>pr [0][v*(-m)]
>v
>pr [0][v*0.1]
>pr [-a][0]
>v
>pr [0][v*(-0.1)]
>pr [0][v*m]
>v
>pr [-0.05][0]
>pr [0][v*0.05]
>pr [a+0.1][0]
>pr [0][v*(-0.05)]
>v
>moverel [-0.05][v*(-m+0.1)]
for n=1 to j
>pr [-0.1][0]
>pr [0][v*(-0.1)]
>v
>pr [0][v*0.05]
>pr [-((a-0.1)/j-0.1)][0]
>v
>pr [0][v*(-0.05)]
>pr [0][v*0.1]
>v
next n
>movexy [x1][y1]
>pr [-a/2-0.1][v*(-0.05)]
>pr [a+0.2][v*(m+0.15)]
>pr [-a-0.1][v*(-m-0.1)]
>pr [a][0]
>b
>moverel [-a][0]
>bdr
>bro
end if
if y2=y1 then
>movexy [x1][y1]
if x2>x1 then h=1
if x2
>pr [h*0.05][-a/2]
>pr [h*m][a]
>secdelc
>pr [h*(-0.05)][0]
>pr [h*(-m)][0]
>v
>pr [h*0.1][0]
>pr [0][-a]
>v
>pr [h*(-0.1)][0]
>pr [h*m][0]
>v
>pr [0][-0.05]
>pr [h*0.05][0]
>pr [0][a+0.1]
>pr [h*(-0.05)][0]
>v
>moverel [h*(-m+0.1)][-0.05]
for n=1 to j
>pr [0][-0.1]
>pr [h*(-0.1)][0]
>v
>pr [h*0.05][0]
>pr [0][-((a-0.1)/j-0.1)]
>v
>pr [h*(-0.05)][0]
>pr [h*0.1][0]
>v
next n
end if
tt=2
a6:
print "
anykey keycode
if keycode=111 then goto a1
if keycode=100 then goto a2
if keycode=118 then
a7:
setpoint "Situa nuevo centro de la pantalla" 1
if sys(1)<>1 then goto a7
pointval aa bb 1
>undo
>pointxy [aa][bb]
input "Factor de zoom" fz
>zoom [fz]
goto a6
end if
if keycode=102 then end
if keycode=27 then
>bd
goto a6
end if
goto a2
No hay comentarios:
Publicar un comentario