hello again¡¡¡¡
i make a lips that draw doors and window in 3d from block in 2d......the problem..It does not work in all autcad¡¡¡¡¡ the same version but different pc.
I suppose that it is an avariable......
the lips stop in this point:
what happen¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
the lips.......
thanks¡¡¡¡¡¡¡¡¡¡¡¡¡
Only thing I found is that in two places you forgot to comment with ; symbol your explanations... Maybe this is where the code fails... I don't have your blocks so I can't check it further... Here is your modified lisp... Hoping that this is only correction that I made, and BTW. you don't need last (defun c:mirar (...) )... It is wrongly written and I think has nothing with main command function definition of routine...
(vl-load-com) (princ "\VENTANA 3D CARGADA. ESCRIBE \"V3D\" PARA EMPEZAR.") ;;;;;CREO LAS CAPAS POR SI NO EXISTEN;;;;; (if (not (tblsearch "LAYER" "EXTRUSION_3D_CARPINTERIA")) (command "_.-layer" "_make" "EXTRUSION_3D_CARPINTERIA" "_color" 4 "" "") ) (if (not (tblsearch "LAYER" "EXTRUSION_3D_VIDRIOS")) (command "_.-layer" "_make" "EXTRUSION_3D_VIDRIOS" "_color" 4 "" "") ) (if (not (tblsearch "LAYER" "EXTRUSION_3D_VIERTEAGUAS")) (command "_.-layer" "_make" "EXTRUSION_3D_VIERTEAGUAS" "_color" 1 "" "") ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:V3D ( / sele cod bloque parametro1 pt giro giro2 ) (prompt "\nblock: ") (setq sele (ssget '((0 . "INSERT") (8 . "CARPINTERIA"))) cod 0 );end setq (setvar 'clayer "EXTRUSION_3D_CARPINTERIA") ; CAMBIAR A LA CAPA (setq ancho_marco (getreal "\n Ancho marco: ")) (setq ancho_marco1 (rtos (* ancho_marco 2) )) (setq ancho_marco11 (rtos ancho_marco )) (setq ancho_marco2 (/ ancho_marco 2)) (repeat (sslength sele) (setq nombrebloque (vla-get-Effectivename (vlax-ename->vla-object (ssname sele cod))) bloque (ssname sele cod) giro (rad_sexa(cdr (assoc 50 (entget bloque)))) giro2 (+ giro 90) giro3 (+ giro 270); angulo para ajustar la polilinea condo no es recto pt (cdr (assoc 10 (entget bloque) )) x (car pt) y (cadr pt) z (caddr pt) parametro1 (GetDynamicPropValue (vlax-ename->vla-object bloque) "ANCHO") obj3 (GetDynamicPropValue (vlax-ename->vla-object bloque) "ALTURA") obj4 (GetDynamicPropValue (vlax-ename->vla-object bloque) "Espesor_muro") obj5 (GetDynamicPropValue (vlax-ename->vla-object bloque) "antepecho") VISIBILIDAD (GetDynamicPropValue (vlax-ename->vla-object bloque) "visibilidad") );end setq (setvar 'clayer "EXTRUSION_3D_CARPINTERIA"); CAMBIAR A LA CAPA (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "ABATIBLE 2 HOJAS") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5 ) pt2 (list x y (+ obj5 obj3 )) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222a (polar pt1 (/ (* giro pi) 180.0) (* ancho_marco 2) ) pt222 (polar pt222a (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4) -1)) pt333 (polar pt222 (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4 ) -1)) pt444 (polar pt333 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 6)) 2 )) pt555 (polar pt222 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 6 )) 2 )) ;;;;;;puntos hoja1;;;;;;marco pt2h (list x y (+ obj5 ancho_marco )) pt3h (polar pt2h (/ (* giro pi) 180.0) ancho_marco ) x1 (car pt3h) y1 (cadr pt3h) z1 (caddr pt3h) pt4h (list x1 y1 (-(+ obj5 obj3)ancho_marco) ) pt5h (polar pt4h (/ (* giro pi) 180.0) (/ (-(- parametro1 ancho_marco)ancho_marco) 2 )) pt6h (polar pt3h (/ (* giro pi) 180.0) (/ (- (- parametro1 ancho_marco)ancho_marco) 2 )) ;;;;;;puntos hoja1;;;;;;perfil pt4hp (polar pt3h (/ (* giro3 pi) 180.0) (* (- ancho_marco ancho_marco2 ) -1 )) pt5hp (polar pt4hp (/ (* giro pi) 180.0) ancho_marco ) pt6hp (polar pt3h (/ (* giro pi) 180.0) ancho_marco ) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") ; MARCO HOJA EXTERIOR (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") ; PERFIL MARCO EXTERIOR (setq perfil1 (entlast)) (command "_3dpoly" pt3h pt4h pt5h pt6h "c") ; MARCO HOJA INTERIOR (setq trayectoria_hoja (entlast)) (command "_3dpoly" pt3h pt4hp pt5hp pt6hp "c") ; PERFIL HOJA INTERIOR (setq perfil_hoja (entlast)) ;(setq perfil_hoja_elevacion (strcat "0,0," ancho_marco1 )) ;(command "_move" perfil_hoja "" "0,0" perfil_hoja_elevacion ) (command "_3dpoly" pt222 pt333 pt444 pt555 "c" ) ; PERFIL VIDRIO (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") ; PERFIL VIERTEAGUAS (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco1 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "t" contorno1 ) (command "_extrude" perfil_hoja "" "t" trayectoria_hoja ) (setq perfil_hoja_extruido (entlast)) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 4) )) (setq vidrio_extruido (entlast)) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") (setq ptd (polar pt (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 2)) 2 ))) (command "_COPY" perfil_hoja_extruido vidrio_extruido "" pt ptd "" ) );end progn );end if (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "FIJA") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5) pt2 (list x y (+ obj5 obj3)) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222 (polar pt1 (/ (* giro3 pi) 180.0) (*(/ ancho_marco 2) -1) ) pt222ok (polar pt222 (/ (* giro pi) 180.0) ancho_marco ) pt333 (polar pt1 (/ (* giro3 pi) 180.0) -0.02 ) pt333ok (polar pt333 (/ (* giro pi) 180.0) ancho_marco ) pt444 (polar pt333 (/ (* giro pi) 180.0) (- parametro1 ancho_marco )) pt555 (polar pt222 (/ (* giro pi) 180.0) (- parametro1 ancho_marco )) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") (setq perfil1 (entlast)) (command "_3dpoly" pt222ok pt333ok pt444 pt555 "c") (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco11 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "t" contorno1 ) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 2) )) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") );end progn );end if (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "CORREDERA 2 HOJAS") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5) pt2 (list x y (+ obj5 obj3)) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222a (polar pt1 (/ (* giro pi) 180.0) (* ancho_marco 2) ) pt222 (polar pt222a (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 2) -1)) pt333 (polar pt222 (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4 ) -1)) pt444 (polar pt333 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 5)) 2 )) pt555 (polar pt222 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 5 )) 2 )) ;;;;;;puntos hoja1;;;;;;marco pt2h (list x y (+ obj5 ancho_marco)) pt3h (polar pt2h (/ (* giro pi) 180.0) ancho_marco ) x1 (car pt3h) y1 (cadr pt3h) z1 (caddr pt3h) pt4h (list x1 y1 (-(+ obj5 obj3)ancho_marco) ) pt5h (polar pt4h (/ (* giro pi) 180.0) (/ (- parametro1 ancho_marco) 2 )) pt6h (polar pt3h (/ (* giro pi) 180.0) (/ (- parametro1 ancho_marco) 2 )) ;;;;;;puntos hoja1;;;;;;perfil pt4hp (polar pt3h (/ (* giro3 pi) 180.0) (* (- ancho_marco ancho_marco2 ) -1 )) pt5hp (polar pt4hp (/ (* giro pi) 180.0) ancho_marco ) pt6hp (polar pt3h (/ (* giro pi) 180.0) ancho_marco ) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") ; MARCO HOJA EXTERIOR (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") ; PERFIL MARCO EXTERIOR (setq perfil1 (entlast)) (command "_3dpoly" pt3h pt4h pt5h pt6h "c") ; MARCO HOJA INTERIOR (setq trayectoria_hoja (entlast)) (command "_3dpoly" pt3h pt4hp pt5hp pt6hp "c") ; PERFIL HOJA INTERIOR (setq perfil_hoja (entlast)) ;(setq perfil_hoja_elevacion (strcat "0,0," ancho_marco1 )) ;(command "_move" perfil_hoja "" "0,0" perfil_hoja_elevacion ) (command "_3dpoly" pt222 pt333 pt444 pt555 "c" ) ; PERFIL VIDRIO (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") ; PERFIL VIERTEAGUAS (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco1 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "t" contorno1 ) (command "_extrude" perfil_hoja "" "t" trayectoria_hoja ) (setq perfil_hoja_extruido (entlast)) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 4) )) (setq vidrio_extruido (entlast)) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") (setq ptd (polar pt (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 3 )) 2 ))) (setq ptd1 (polar ptd (/ (* giro3 pi) 180.0) (* ancho_marco2 -1) )) (command "_COPY" perfil_hoja_extruido vidrio_extruido "" pt ptd1 "" ) );end progn );end if (setq cod (1+ cod)) );end repeat (princ) ); end defun ;;------------=={ Get Dynamic Property Value }==--------------;; ;; ;; ;; Returns the value of a Dynamic Block Property, if present ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; block - VLA Dynamic Block Reference Object ;; ;; prop - Dynamic Block Property Name ;; ;;------------------------------------------------------------;; ;; Returns: Value of property, else nil ;; ;;------------------------------------------------------------;; (defun GetDynamicPropValue ( block prop ) (setq prop (strcase prop)) (vl-some (function (lambda ( _prop ) (if (eq prop (strcase (vla-get-propertyname _prop))) (vlax-get _prop 'Value) ) ) ) (vlax-invoke block 'GetDynamicBlockProperties) ) ) ;;;;; pasar de radianes a grados;;;;;; (defun rad_sexa ( radianes ) (/ (* radianes 180.0) PI) ) ;;;;;;;;;;;;;;;;;;;;;punto medio;;;;;;;;;;;;;;;;;;;;;;; (defun mid ( p1 p2 ) (list (/ (+ (car p1) (car p2)) 2.0) (/ (+ (cadr p1) (cadr p2)) 2.0) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:mirar ( / sele cod bloque parametro1 pt ) (setq bloque_1 (entget (car (entsel)))) )
M.R.
Test it now... It was "t" - taper option in extrude command, instead of "p" - path option... I've commented last (defun) as it's unnecessary...
Check it now and tell me does it work for you...
(vl-load-com) (princ "\VENTANA 3D CARGADA. ESCRIBE \"V3D\" PARA EMPEZAR.") ;;;;;CREO LAS CAPAS POR SI NO EXISTEN;;;;; (if (not (tblsearch "LAYER" "EXTRUSION_3D_CARPINTERIA")) (command "_.-layer" "_make" "EXTRUSION_3D_CARPINTERIA" "_color" 4 "" "") ) (if (not (tblsearch "LAYER" "EXTRUSION_3D_VIDRIOS")) (command "_.-layer" "_make" "EXTRUSION_3D_VIDRIOS" "_color" 4 "" "") ) (if (not (tblsearch "LAYER" "EXTRUSION_3D_VIERTEAGUAS")) (command "_.-layer" "_make" "EXTRUSION_3D_VIERTEAGUAS" "_color" 1 "" "") ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:V3D ( / sele cod bloque parametro1 pt giro giro2 ancho_marco ancho_marco1 ancho_marco11 ancho_marco2 contorno1 elevacion_vidrio giro3 nombrebloque obj3 obj4 obj5 perfil1 perfil_hoja perfil_hoja_extruido pt1 pt2 pt22 pt222 pt222a pt222ok pt2h pt2v pt3 pt33 pt333 pt333ok pt3h pt3v pt4 pt44 pt444 pt4h pt4hp pt4v pt555 pt5h pt5hp pt5v pt6h pt6hp pt6v pt7v pt8v ptd ptd1 trayectoria_hoja vidrio vidrio_extruido vierte_aguas visibilidad x x1 y y1 z z1 ) (prompt "\nSelect block(s): ") (setq sele (ssget '((0 . "INSERT") (8 . "CARPINTERIA"))) cod 0 );end setq (setvar 'clayer "EXTRUSION_3D_CARPINTERIA") ; CAMBIAR A LA CAPA (setq ancho_marco (getreal "\n Ancho marco: ")) (setq ancho_marco1 (rtos (* ancho_marco 2.0))) (setq ancho_marco11 (rtos ancho_marco)) (setq ancho_marco2 (/ ancho_marco 2.0)) (repeat (sslength sele) (setq nombrebloque (vla-get-Effectivename (vlax-ename->vla-object (ssname sele cod))) bloque (ssname sele cod) giro (rad_sexa(cdr (assoc 50 (entget bloque)))) giro2 (+ giro 90) giro3 (+ giro 270); angulo para ajustar la polilinea condo no es recto pt (cdr (assoc 10 (entget bloque) )) x (car pt) y (cadr pt) z (caddr pt) parametro1 (GetDynamicPropValue (vlax-ename->vla-object bloque) "ANCHO") obj3 (GetDynamicPropValue (vlax-ename->vla-object bloque) "ALTURA") obj4 (GetDynamicPropValue (vlax-ename->vla-object bloque) "Espesor_muro") obj5 (GetDynamicPropValue (vlax-ename->vla-object bloque) "antepecho") VISIBILIDAD (GetDynamicPropValue (vlax-ename->vla-object bloque) "visibilidad") );end setq (setvar 'clayer "EXTRUSION_3D_CARPINTERIA"); CAMBIAR A LA CAPA (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "ABATIBLE 2 HOJAS") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5 ) pt2 (list x y (+ obj5 obj3 )) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222a (polar pt1 (/ (* giro pi) 180.0) (* ancho_marco 2) ) pt222 (polar pt222a (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4) -1)) pt333 (polar pt222 (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4 ) -1)) pt444 (polar pt333 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 6)) 2 )) pt555 (polar pt222 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 6 )) 2 )) ;;;;;;puntos hoja1;;;;;;marco pt2h (list x y (+ obj5 ancho_marco )) pt3h (polar pt2h (/ (* giro pi) 180.0) ancho_marco ) x1 (car pt3h) y1 (cadr pt3h) z1 (caddr pt3h) pt4h (list x1 y1 (-(+ obj5 obj3)ancho_marco) ) pt5h (polar pt4h (/ (* giro pi) 180.0) (/ (-(- parametro1 ancho_marco)ancho_marco) 2 )) pt6h (polar pt3h (/ (* giro pi) 180.0) (/ (- (- parametro1 ancho_marco)ancho_marco) 2 )) ;;;;;;puntos hoja1;;;;;;perfil pt4hp (polar pt3h (/ (* giro3 pi) 180.0) (* (- ancho_marco ancho_marco2 ) -1 )) pt5hp (polar pt4hp (/ (* giro pi) 180.0) ancho_marco ) pt6hp (polar pt3h (/ (* giro pi) 180.0) ancho_marco ) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") ; MARCO HOJA EXTERIOR (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") ; PERFIL MARCO EXTERIOR (setq perfil1 (entlast)) (command "_3dpoly" pt3h pt4h pt5h pt6h "c") ; MARCO HOJA INTERIOR (setq trayectoria_hoja (entlast)) (command "_3dpoly" pt3h pt4hp pt5hp pt6hp "c") ; PERFIL HOJA INTERIOR (setq perfil_hoja (entlast)) ;(setq perfil_hoja_elevacion (strcat "0,0," ancho_marco1 )) ;(command "_move" perfil_hoja "" "0,0" perfil_hoja_elevacion ) (command "_3dpoly" pt222 pt333 pt444 pt555 "c" ) ; PERFIL VIDRIO (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") ; PERFIL VIERTEAGUAS (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco1 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "p" contorno1 ) (command "_extrude" perfil_hoja "" "p" trayectoria_hoja ) (setq perfil_hoja_extruido (entlast)) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 4) )) (setq vidrio_extruido (entlast)) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") (setq ptd (polar pt (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 2)) 2 ))) (command "_COPY" perfil_hoja_extruido vidrio_extruido "" pt ptd "" ) );end progn );end if (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "FIJA") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5) pt2 (list x y (+ obj5 obj3)) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222 (polar pt1 (/ (* giro3 pi) 180.0) (*(/ ancho_marco 2) -1) ) pt222ok (polar pt222 (/ (* giro pi) 180.0) ancho_marco ) pt333 (polar pt1 (/ (* giro3 pi) 180.0) -0.02 ) pt333ok (polar pt333 (/ (* giro pi) 180.0) ancho_marco ) pt444 (polar pt333 (/ (* giro pi) 180.0) (- parametro1 ancho_marco )) pt555 (polar pt222 (/ (* giro pi) 180.0) (- parametro1 ancho_marco )) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") (setq perfil1 (entlast)) (command "_3dpoly" pt222ok pt333ok pt444 pt555 "c") (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco11 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "p" contorno1 ) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 2) )) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") );end progn );end if (if (and (= nombrebloque "Ventana_F+A+C+Vierte") (= VISIBILIDAD "CORREDERA 2 HOJAS") );end and (progn ;;;;;;puntos marco;;;;;; (setq pt1 (list x y obj5) pt2 (list x y (+ obj5 obj3)) pt3 (polar pt2 (/ (* giro pi) 180.0) parametro1 ) pt4 (polar pt1 (/ (* giro pi) 180.0) parametro1 ) ;;;;;;puntos perfil;;;;;; pt22 (polar pt1 (/ (* giro pi) 180.0) ancho_marco ) pt33 (polar pt22 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) pt44 (polar pt1 (/ (* giro3 pi) 180.0) (* ancho_marco -1) ) ;;;;;;puntos vidrio;;;;;; pt222a (polar pt1 (/ (* giro pi) 180.0) (* ancho_marco 2) ) pt222 (polar pt222a (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 2) -1)) pt333 (polar pt222 (/ (* giro3 pi) 180.0) (*(/ ancho_marco2 4 ) -1)) pt444 (polar pt333 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 5)) 2 )) pt555 (polar pt222 (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 5 )) 2 )) ;;;;;;puntos hoja1;;;;;;marco pt2h (list x y (+ obj5 ancho_marco)) pt3h (polar pt2h (/ (* giro pi) 180.0) ancho_marco ) x1 (car pt3h) y1 (cadr pt3h) z1 (caddr pt3h) pt4h (list x1 y1 (-(+ obj5 obj3)ancho_marco) ) pt5h (polar pt4h (/ (* giro pi) 180.0) (/ (- parametro1 ancho_marco) 2 )) pt6h (polar pt3h (/ (* giro pi) 180.0) (/ (- parametro1 ancho_marco) 2 )) ;;;;;;puntos hoja1;;;;;;perfil pt4hp (polar pt3h (/ (* giro3 pi) 180.0) (* (- ancho_marco ancho_marco2 ) -1 )) pt5hp (polar pt4hp (/ (* giro pi) 180.0) ancho_marco ) pt6hp (polar pt3h (/ (* giro pi) 180.0) ancho_marco ) ;;;;;;puntos vierteaguas;;;;;; pt2v (polar pt1 (/ (* giro pi) 180.0) parametro1) pt3v (polar pt2v (/ (* giro2 pi) 180) obj4) pt4v (polar pt3v (/ (* giro pi) 180) 0.05) pt5v (polar pt4v (/ (* giro2 pi) 180) 0.05) pt6v (polar pt1 (/ (* giro2 pi) 180) obj4) pt7v (polar pt6v (/ (* giro pi) 180) -0.05) pt8v (polar pt7v (/ (* giro2 pi) 180) 0.05) );end setq (command "_3dpoly" pt1 pt2 pt3 pt4 "c") ; MARCO HOJA EXTERIOR (setq contorno1 (entlast)) (command "_3dpoly" pt1 pt22 pt33 pt44 "c") ; PERFIL MARCO EXTERIOR (setq perfil1 (entlast)) (command "_3dpoly" pt3h pt4h pt5h pt6h "c") ; MARCO HOJA INTERIOR (setq trayectoria_hoja (entlast)) (command "_3dpoly" pt3h pt4hp pt5hp pt6hp "c") ; PERFIL HOJA INTERIOR (setq perfil_hoja (entlast)) ;(setq perfil_hoja_elevacion (strcat "0,0," ancho_marco1 )) ;(command "_move" perfil_hoja "" "0,0" perfil_hoja_elevacion ) (command "_3dpoly" pt222 pt333 pt444 pt555 "c" ) ; PERFIL VIDRIO (setq vidrio (entlast)) (command "_3dpoly" pt8v pt7v pt6v pt1 pt2v pt3v pt4v pt5v "c") ; PERFIL VIERTEAGUAS (setq vierte_aguas (entlast)) (setq elevacion_vidrio (strcat "0,0," ancho_marco1 )) (command "_move" vidrio "" "0,0" elevacion_vidrio ) (command "_extrude" perfil1 "" "p" contorno1 ) (command "_extrude" perfil_hoja "" "p" trayectoria_hoja ) (setq perfil_hoja_extruido (entlast)) (command "_extrude" vidrio "" (- obj3 (* ancho_marco 4) )) (setq vidrio_extruido (entlast)) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIDRIOS" "") (command "_extrude" vierte_aguas "" -0.03 ) (command "_chprop" (entlast) "" "_Layer" "EXTRUSION_3D_VIERTEAGUAS" "") (setq ptd (polar pt (/ (* giro pi) 180.0) (/ (- parametro1 (* ancho_marco 3 )) 2 ))) (setq ptd1 (polar ptd (/ (* giro3 pi) 180.0) (* ancho_marco2 -1) )) (command "_COPY" perfil_hoja_extruido vidrio_extruido "" pt ptd1 "" ) );end progn );end if (setq cod (1+ cod)) );end repeat (princ) ); end defun ;;------------=={ Get Dynamic Property Value }==--------------;; ;; ;; ;; Returns the value of a Dynamic Block Property, if present ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; block - VLA Dynamic Block Reference Object ;; ;; prop - Dynamic Block Property Name ;; ;;------------------------------------------------------------;; ;; Returns: Value of property, else nil ;; ;;------------------------------------------------------------;; (defun GetDynamicPropValue ( block prop ) (setq prop (strcase prop)) (vl-some (function (lambda ( _prop ) (if (eq prop (strcase (vla-get-propertyname _prop))) (vlax-get _prop 'Value) ) ) ) (vlax-invoke block 'GetDynamicBlockProperties) ) ) ;;;;; pasar de radianes a grados;;;;;; (defun rad_sexa ( radianes ) (/ (* radianes 180.0) PI) ) ;;;;;;;;;;;;;;;;;;;;;punto medio;;;;;;;;;;;;;;;;;;;;;;; (defun mid ( p1 p2 ) (list (/ (+ (car p1) (car p2)) 2.0) (/ (+ (cadr p1) (cadr p2)) 2.0) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;(defun c:mirar ( / sele cod bloque parametro1 pt ) ;;; (setq bloque_1 (entget (car (entsel)))) ;;;)
M.R.
ains¡¡¡ dont work..... .....remember...the lips work fine in other pc.
work in your pc?
@andresep82 wrote:
ains¡¡¡ dont work..... .....remember...the lips work fine in other pc.
work in your pc?
Yes, with my last code and your dwg with blocks it works fine...
I don't know what could be the problem... It wasn't working before with "t" taper option like it was in original lisp... I said - I looked what should command extrude do and change "t" option to "p" - path option... After that it all worked fine...
ooh my good......i try reinstall cad tomorrow,now is to later .......and.... change "t" option to "p" diferent version of cad? spanish and english pehaps....
thanks¡¡¡¡¡
Las opciones de un Command , tambien deben ir precedidas por el GUIÓN BAJO "_P" o "_T".
nothing,dont work......
devitg,gracias por prestarme tu ayuda,ese conjunto de bloques son el mismo pero dinamicos,abre el panel de propiedades y fijate que en personalizado tienen propiedades, por otra parte estados de visibilidad y alargamiento.