Acotar Angulos
3 participantes
Página 1 de 1.
Acotar Angulos
Que tal colegas del Foro.
Estoy buscando un lisp para acotar Angulo pero que el texto sea Perpendicular al
mismo Orientación Texto Ya que en la Configuración de cotas en AutoCAD no posee
Nuevamente Gracias por los aportes .
•Texto de Cota Horizontal
•Texto de Cota Perpendicular
•Texto de Cota Paralelo
Estoy buscando un lisp para acotar Angulo pero que el texto sea Perpendicular al
mismo Orientación Texto Ya que en la Configuración de cotas en AutoCAD no posee
Nuevamente Gracias por los aportes .
•Texto de Cota Horizontal
•Texto de Cota Perpendicular
•Texto de Cota Paralelo
Luis Alberto Benitez- Mensajes : 112
Fecha de inscripción : 29/03/2016
mostrar ejemplo
Luis Alberto Benitez escribió:Que tal colegas del Foro.
Estoy buscando un lisp para acotar Angulo pero que el texto sea Perpendicular al
mismo Orientación Texto Ya que en la Configuración de cotas en AutoCAD no posee
Nuevamente Gracias por los aportes .
•Texto de Cota Horizontal
•Texto de Cota Perpendicular
•Texto de Cota Paralelo
Re: Acotar Angulos
Hola Gabriel y Luis
No sé si entendí bien lo del ángulo.
Este código rota el texto de dimensiones existentes:
podría servir de base para crear una función que acote ya con el ángulo, o simplemente correrlo así una vez terminado el acotado.
No sé si entendí bien lo del ángulo.
Este código rota el texto de dimensiones existentes:
- Código:
(defun c:nombre (/ i ss lent ang )
(if (setq i 0
ss (ssget '((0 . "DIMENSION")(100 . "AcDb2LineAngularDimension")))
)
(repeat
(sslength ss)
(setq lent (entget (ssname ss i))
i (1+ i)
ang (angle (cdr (assoc 11 lent)) (cdr (assoc 14 lent)) )
)
(if (< 1.5708 ang 4.7124)
(setq ang (+ ang pi))
)
(entmod
(subst
(cons 53 ang)
(assoc 53 lent)
lent
)
)
)
)
)
podría servir de base para crear una función que acote ya con el ángulo, o simplemente correrlo así una vez terminado el acotado.
Gerardo Calvo- Mensajes : 46
Fecha de inscripción : 29/10/2019
textos perpendicular al elemento acotado
Lo gira pero lo pone paralelo al eje X , o al eje Y y creo que Luis lo quiere perpendicular a elemento acotado .
textos cotas perpendiculares
Adjunto un archivo TXT . cambiar a LSP .
;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;
;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA
;;; Copyleft 1995-2023 by Gabriel Calos De Vit ; DEVITG@GMAIL.COM
;;
; Hecho por Gabo CALOS DE VIT de CORDOBA ARGENTINA
;;; Copyleft 1995-2023 por Gabriel Calos De Vit
;; DEVITG@GMAIL.COM
;;; inicio-defun-13-07-23
;;************************************************************************************************************
;; flaco luis acad hispano
;;;
(DEFUN INITIO ()
(VL-LOAD-COM)
(SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD
(SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
(SETQ MODEL (VLA-GET-MODELSPACE ADOC))
(SETQ SELECTIONSETS (VLA-GET-SELECTIONSETS ADOC))
(SETQ APPA (VLA-GET-APPLICATION ADOC))
(SETQ UTIL (VLA-GET-UTILITY ADOC))
(SETQ LAY-COLL (VLA-GET-LAYERS ADOC))
(SETQ BLOCK-COLL (VLA-GET-BLOCKS ADOC))
)
;;************************************************************
(DEFUN COTAS-PERP (/
ADOC
ANG
AUXLINE
DIM
DIM-ENT-SS
DIM-OBJ-SS
EXT-LIN1-PT
EXT-LIN2-PT
MODEL
NEW-ANG
SS
TEXT-ROTATION
VERTICAL-TEXT-POSITION
)
(INITIO)
(SETQ DIM-ENT-SS (SSGET "_X" '((0 . "DIMENSION") (100 . "AcDb2LineAngularDimension"))))
(SETQ DIM-OBJ-SS (VLA-GET-ACTIVESELECTIONSET ADOC))
(VLAX-FOR DIM-OBJ DIM-OBJ-SS
(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))
(SETQ TEXT-ROTATION (VLA-GET-TEXTROTATION DIM-OBJ))
(SETQ VERTICAL-TEXT-POSITION (VLA-GET-VERTICALTEXTPOSITION DIM-OBJ))
;;; 0 acVertCentered
;;; 1 acabove
;;; 2 acunder
;;; 3 acoutside
(SETQ AUXLINE (VLA-ADDLINE MODEL EXT-LIN1-PT EXT-LIN2-PT))
(SETQ ANG (VLA-GET-ANGLE AUXLINE))
(SETQ NEW-ANG (+ ANG (* PI 0.5)))
(VLA-PUT-TEXTROTATION DIM-OBJ NEW-ANG)
(VLA-DELETE AUXLINE)
(VLA-PUT-VERTICALTEXTPOSITION DIM-OBJ 3)
) ;end vlax-for
)
(DEFUN C:CT-PER ()
(COTAS-PERP)
(PRINC)
)
|«Visual LISP:copyright: Format Options»
(180 2 1 0 nil "end of " 100 20 2 2 nil nil T nil T)
;*** DO NOT add text below the comment! ***|;
;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;
;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA
;;; Copyleft 1995-2023 by Gabriel Calos De Vit ; DEVITG@GMAIL.COM
;;
; Hecho por Gabo CALOS DE VIT de CORDOBA ARGENTINA
;;; Copyleft 1995-2023 por Gabriel Calos De Vit
;; DEVITG@GMAIL.COM
;;; inicio-defun-13-07-23
;;************************************************************************************************************
;; flaco luis acad hispano
;;;
(DEFUN INITIO ()
(VL-LOAD-COM)
(SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD
(SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
(SETQ MODEL (VLA-GET-MODELSPACE ADOC))
(SETQ SELECTIONSETS (VLA-GET-SELECTIONSETS ADOC))
(SETQ APPA (VLA-GET-APPLICATION ADOC))
(SETQ UTIL (VLA-GET-UTILITY ADOC))
(SETQ LAY-COLL (VLA-GET-LAYERS ADOC))
(SETQ BLOCK-COLL (VLA-GET-BLOCKS ADOC))
)
;;************************************************************
(DEFUN COTAS-PERP (/
ADOC
ANG
AUXLINE
DIM
DIM-ENT-SS
DIM-OBJ-SS
EXT-LIN1-PT
EXT-LIN2-PT
MODEL
NEW-ANG
SS
TEXT-ROTATION
VERTICAL-TEXT-POSITION
)
(INITIO)
(SETQ DIM-ENT-SS (SSGET "_X" '((0 . "DIMENSION") (100 . "AcDb2LineAngularDimension"))))
(SETQ DIM-OBJ-SS (VLA-GET-ACTIVESELECTIONSET ADOC))
(VLAX-FOR DIM-OBJ DIM-OBJ-SS
(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))
(SETQ TEXT-ROTATION (VLA-GET-TEXTROTATION DIM-OBJ))
(SETQ VERTICAL-TEXT-POSITION (VLA-GET-VERTICALTEXTPOSITION DIM-OBJ))
;;; 0 acVertCentered
;;; 1 acabove
;;; 2 acunder
;;; 3 acoutside
(SETQ AUXLINE (VLA-ADDLINE MODEL EXT-LIN1-PT EXT-LIN2-PT))
(SETQ ANG (VLA-GET-ANGLE AUXLINE))
(SETQ NEW-ANG (+ ANG (* PI 0.5)))
(VLA-PUT-TEXTROTATION DIM-OBJ NEW-ANG)
(VLA-DELETE AUXLINE)
(VLA-PUT-VERTICALTEXTPOSITION DIM-OBJ 3)
) ;end vlax-for
)
(DEFUN C:CT-PER ()
(COTAS-PERP)
(PRINC)
)
|«Visual LISP:copyright: Format Options»
(180 2 1 0 nil "end of " 100 20 2 2 nil nil T nil T)
;*** DO NOT add text below the comment! ***|;
- Archivos
No entendí la pregunta
Confundí el ángulo del texto de la dim, para líneas y lo pedido es para el texto de las dim de ángulos .
pone textos cotas ang y linear perpendicular
Creo que lo he resuelto para las DIMLINEAR y DIMANGULAR .
;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;
;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA
;;; Copyleft 1995-2023 by Gabriel Calos De Vit ; DEVITG@GMAIL.COM
;;
; Hecho por Gabo CALOS DE VIT de CORDOBA ARGENTINA
;;; Copyleft 1995-2023 por Gabriel Calos De Vit
;; DEVITG@GMAIL.COM
;;; inicio-defun-15-07-23
;; Readable - Lee Mac
;;;http://www.lee-mac.com/
;; Returns an angle corrected for text readability.
(defun LM:readable ( a )
( (lambda ( a )
(if (< a 0.0)
(LM:readable a)
(if (and (< (* pi 0.5) a) (<= a (* pi 1.5)))
(LM:readable (+ a pi))
a
)
)
)
(rem (+ a pi pi) (+ pi pi))
)
)
;;************************************************************************************************************
;; flaco luis acad hispano
;;;
(DEFUN INITIO ()
(VL-LOAD-COM)
(SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD
(SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
(SETQ MODEL (VLA-GET-MODELSPACE ADOC))
(SETQ SELECTIONSETS (VLA-GET-SELECTIONSETS ADOC))
)
(DEFUN COTAS-PERP (/
ADOC
ANG
AUXLINE
DIM-ENT-SS
DIM-OBJ-SS
EXT-LIN1-PT
EXT-LIN2-PT
MODEL
NEW-ANG
READ-ANGLE
TEXT-ROTATION
VERTICAL-TEXT-POSITION
)
(INITIO)
;;; (SETQ DIM-ENT-SS (SSGET "_X" '((0 . "DIMENSION") (100 . "AcDb2LineAngularDimension"))))
(SETQ DIM-ENT-SS (SSGET "_x"
'((0 . "DIMENSION")
(-4 . "<OR")
(70 . 33);aligned
(70 . 34);angular
(-4 . "OR>")
(100 . "AcDb2LineAngularDimension"))))
;;;(-4 . "<OR") (40 . 1.0) (8 . "0") (62 . 3) (-4 . "OR>")
;;************************************************************
;;;70 Dimension type:
;;;Values 0-6 are integer values that represent the dimension type. Values 32, 64, and 128
;;;are bit values, which are added to the integer values (value 32 is always set in R13 and
;;;later releases)
;;;0 = Rotated, horizontal, or vertical; 1 = Aligned
;;;2 = Angular; 3 = Diameter; 4 = Radius
;;;5 = Angular 3 point; 6 = Ordinate
;;;32 = Indicates that the block reference (group code 2) is referenced by this dimension only
;;;64 = Ordinate type. This is a bit value (bit 7) used only with integer value 6. If set, ordinate
;;;is X-type; if not set, ordinate is Y-type
;;;128 = This is a bit value (bit added to the other group 70 values if the dimension text
;;;has been positioned at a user-defined location rather than at the default location
;;;(SETQ DIM (SSNAME DIM-ENT-SS 0))
(setq dim-data (entget diM))
(setq 70-dxf-data (cdr (assoc 70 dim-data)))
(setq dim-obj (vlax-ename->vla-object dim))
(vlax-dump-Object dim-obj t)
(SETQ DIM-OBJ-SS (VLA-GET-ACTIVESELECTIONSET ADOC))
(VLAX-FOR DIM-OBJ DIM-OBJ-SS
;;; (cond
;;; ((= 70-DXF-DATA 37) ;ang 3 pt
;;; ((SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ))))
;;;((= 70-DXF-DATA 34) ; ang
;;; ((progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)))))
;;;((= 70-DXF-DATA 33) ; aligned
;;; (progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))))
;;;
;;;
;;;
;;;
;;; )
(if (= 70-DXF-DATA 34) ; ang
(progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)))
)
(if (= 70-DXF-DATA 33) ; aligned
(progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))))
(SETQ TEXT-ROTATION (VLA-GET-TEXTROTATION DIM-OBJ))
(SETQ VERTICAL-TEXT-POSITION (VLA-GET-VERTICALTEXTPOSITION DIM-OBJ))
;;; 0 acVertCentered
;;; 1 acabove
;;; 2 acunder
;;; 3 acoutside
(SETQ AUXLINE (VLA-ADDLINE MODEL EXT-LIN1-PT EXT-LIN2-PT))
(VLA-PUT-COLOR AUXLINE ACblue)
(SETQ ANG (VLA-GET-ANGLE AUXLINE))
(SETQ NEW-ANG (+ ANG (* PI 0.5)))
(SETQ READ-ANGLE (LM:READABLE NEW-ANG))
(VLA-PUT-TEXTROTATION DIM-OBJ READ-ANGLE)
(VLA-DELETE AUXLINE)
(VLA-PUT-VERTICALTEXTPOSITION DIM-OBJ 3)
) ;end vlax-for
) ;end COTAS-PERP
(DEFUN C:CT-PERP ()
(COTAS-PERP)
(PRINC)
)
Ruego probar y enviar comentarios. Lo pueden hace a mi email.
;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;
;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA
;;; Copyleft 1995-2023 by Gabriel Calos De Vit ; DEVITG@GMAIL.COM
;;
; Hecho por Gabo CALOS DE VIT de CORDOBA ARGENTINA
;;; Copyleft 1995-2023 por Gabriel Calos De Vit
;; DEVITG@GMAIL.COM
;;; inicio-defun-15-07-23
;; Readable - Lee Mac
;;;http://www.lee-mac.com/
;; Returns an angle corrected for text readability.
(defun LM:readable ( a )
( (lambda ( a )
(if (< a 0.0)
(LM:readable a)
(if (and (< (* pi 0.5) a) (<= a (* pi 1.5)))
(LM:readable (+ a pi))
a
)
)
)
(rem (+ a pi pi) (+ pi pi))
)
)
;;************************************************************************************************************
;; flaco luis acad hispano
;;;
(DEFUN INITIO ()
(VL-LOAD-COM)
(SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD
(SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
(SETQ MODEL (VLA-GET-MODELSPACE ADOC))
(SETQ SELECTIONSETS (VLA-GET-SELECTIONSETS ADOC))
)
(DEFUN COTAS-PERP (/
ADOC
ANG
AUXLINE
DIM-ENT-SS
DIM-OBJ-SS
EXT-LIN1-PT
EXT-LIN2-PT
MODEL
NEW-ANG
READ-ANGLE
TEXT-ROTATION
VERTICAL-TEXT-POSITION
)
(INITIO)
;;; (SETQ DIM-ENT-SS (SSGET "_X" '((0 . "DIMENSION") (100 . "AcDb2LineAngularDimension"))))
(SETQ DIM-ENT-SS (SSGET "_x"
'((0 . "DIMENSION")
(-4 . "<OR")
(70 . 33);aligned
(70 . 34);angular
(-4 . "OR>")
(100 . "AcDb2LineAngularDimension"))))
;;;(-4 . "<OR") (40 . 1.0) (8 . "0") (62 . 3) (-4 . "OR>")
;;************************************************************
;;;70 Dimension type:
;;;Values 0-6 are integer values that represent the dimension type. Values 32, 64, and 128
;;;are bit values, which are added to the integer values (value 32 is always set in R13 and
;;;later releases)
;;;0 = Rotated, horizontal, or vertical; 1 = Aligned
;;;2 = Angular; 3 = Diameter; 4 = Radius
;;;5 = Angular 3 point; 6 = Ordinate
;;;32 = Indicates that the block reference (group code 2) is referenced by this dimension only
;;;64 = Ordinate type. This is a bit value (bit 7) used only with integer value 6. If set, ordinate
;;;is X-type; if not set, ordinate is Y-type
;;;128 = This is a bit value (bit added to the other group 70 values if the dimension text
;;;has been positioned at a user-defined location rather than at the default location
;;;(SETQ DIM (SSNAME DIM-ENT-SS 0))
(setq dim-data (entget diM))
(setq 70-dxf-data (cdr (assoc 70 dim-data)))
(setq dim-obj (vlax-ename->vla-object dim))
(vlax-dump-Object dim-obj t)
(SETQ DIM-OBJ-SS (VLA-GET-ACTIVESELECTIONSET ADOC))
(VLAX-FOR DIM-OBJ DIM-OBJ-SS
;;; (cond
;;; ((= 70-DXF-DATA 37) ;ang 3 pt
;;; ((SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ))))
;;;((= 70-DXF-DATA 34) ; ang
;;; ((progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)))))
;;;((= 70-DXF-DATA 33) ; aligned
;;; (progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
;;; (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))))
;;;
;;;
;;;
;;;
;;; )
(if (= 70-DXF-DATA 34) ; ang
(progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)))
)
(if (= 70-DXF-DATA 33) ; aligned
(progn(SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1POINT DIM-OBJ))
(SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2POINT DIM-OBJ))))
(SETQ TEXT-ROTATION (VLA-GET-TEXTROTATION DIM-OBJ))
(SETQ VERTICAL-TEXT-POSITION (VLA-GET-VERTICALTEXTPOSITION DIM-OBJ))
;;; 0 acVertCentered
;;; 1 acabove
;;; 2 acunder
;;; 3 acoutside
(SETQ AUXLINE (VLA-ADDLINE MODEL EXT-LIN1-PT EXT-LIN2-PT))
(VLA-PUT-COLOR AUXLINE ACblue)
(SETQ ANG (VLA-GET-ANGLE AUXLINE))
(SETQ NEW-ANG (+ ANG (* PI 0.5)))
(SETQ READ-ANGLE (LM:READABLE NEW-ANG))
(VLA-PUT-TEXTROTATION DIM-OBJ READ-ANGLE)
(VLA-DELETE AUXLINE)
(VLA-PUT-VERTICALTEXTPOSITION DIM-OBJ 3)
) ;end vlax-for
) ;end COTAS-PERP
(DEFUN C:CT-PERP ()
(COTAS-PERP)
(PRINC)
)
Ruego probar y enviar comentarios. Lo pueden hace a mi email.
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.
|
|