Apagar Grid en todos los Layout, viewports y model
4 participantes
Página 1 de 1.
Apagar Grid en todos los Layout, viewports y model
Hola muchachos como están.
Disculpen, quería hacerles una consulta sobre como apagar el grid (F7) en todas las ventanas contando el model.
Es que hasta el día de hoy lo hacia con la variable (setvar "gridmode" 0) y funciona bien en el model, pero si entro al layout tengo que estar entrando a cada ventana, luego desactivarlo y volverme a salir de la ventana.
Como podría automatizar esta tarea.
Gracias.
Disculpen, quería hacerles una consulta sobre como apagar el grid (F7) en todas las ventanas contando el model.
Es que hasta el día de hoy lo hacia con la variable (setvar "gridmode" 0) y funciona bien en el model, pero si entro al layout tengo que estar entrando a cada ventana, luego desactivarlo y volverme a salir de la ventana.
Como podría automatizar esta tarea.
Gracias.
carlosmgilp- Mensajes : 149
Fecha de inscripción : 17/03/2016
Edad : 42
Localización : Venezuela
Re: Apagar Grid en todos los Layout, viewports y model
GRID es una propiedad , sigue las instrucciones de SAN HELP
- Código:
GridOn Property (ActiveX)
Specifies the status of the viewport grid.
Supported platforms: Windows only
Signature
VBA:
object.GridOnobject
Type: PViewport, Viewport
The objects this property applies to.
Property Value
Read-only: No
Type: Boolean
True: The grid is on.
False: The grid is off.
Remarks
The grid is used only for visual reference. It is not plotted, nor is it considered part of the drawing. The grid origin is set by the SnapBasePoint method.
When the grid is turned on, it is set to the current grid spacing. To change the grid spacing, use the SetGridSpacing method.
When you turn the grid on or off on a viewport, the visibility of the grid will not change until the viewport is made active. If you toggle the grid of the active viewport, the visibility of the grid will not change until the viewport is reset as the active viewport. To set or reset the viewport as the active viewport, use the ActiveViewport property with the updated viewport object.
NoteThe value of this property is stored in the GRIDMODE system variable. When using the SetVariable method to update the grid mode of the active viewport, you do not have to reset the viewport as the active viewport to see the change.
Examples
VBA:
Sub Example_GridOn()
' This example toggles the setting of GridOn.
Dim viewportObj As AcadViewport
' Set the viewportObj variable to the activeviewport
Set viewportObj = ThisDrawing.ActiveViewport
TOGGLEGRID:
If MsgBox("Toggle the grid?", vbOKCancel, "GridOn Example") = vbOK Then
viewportObj.GridOn = Not (viewportObj.GridOn)
Else
Exit Sub
End If
' Reset the active viewport to see the change
ThisDrawing.ActiveViewport = viewportObj
GoTo TOGGLEGRID
End SubVisual LISP:
(vl-load-com)
(defun c:Example_GridOn()
;; This example toggles the setting of GridOn.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Set the viewportObj variable to the activeviewport
(setq viewportObj (vla-get-ActiveViewport doc))
(vla-put-GridOn viewportObj (if (= (vla-get-GridOn viewportObj) :vlax-true) :vlax-false :vlax-true))
;; Reset the active viewport to see the change
(vla-put-ActiveViewport doc viewportObj)
(vla-Regen doc acAllViewports)
(alert "Toggled the display of the grid.")
)
Re: Apagar Grid en todos los Layout, viewports y model
GRID es una propiedad , sigue las instrucciones de SAN HELP
- Código:
GridOn Property (ActiveX)
Specifies the status of the viewport grid.
Supported platforms: Windows only
Signature
VBA:
object.GridOnobject
Type: PViewport, Viewport
The objects this property applies to.
Property Value
Read-only: No
Type: Boolean
True: The grid is on.
False: The grid is off.
Remarks
The grid is used only for visual reference. It is not plotted, nor is it considered part of the drawing. The grid origin is set by the SnapBasePoint method.
When the grid is turned on, it is set to the current grid spacing. To change the grid spacing, use the SetGridSpacing method.
When you turn the grid on or off on a viewport, the visibility of the grid will not change until the viewport is made active. If you toggle the grid of the active viewport, the visibility of the grid will not change until the viewport is reset as the active viewport. To set or reset the viewport as the active viewport, use the ActiveViewport property with the updated viewport object.
NoteThe value of this property is stored in the GRIDMODE system variable. When using the SetVariable method to update the grid mode of the active viewport, you do not have to reset the viewport as the active viewport to see the change.
Examples
VBA:
Sub Example_GridOn()
' This example toggles the setting of GridOn.
Dim viewportObj As AcadViewport
' Set the viewportObj variable to the activeviewport
Set viewportObj = ThisDrawing.ActiveViewport
TOGGLEGRID:
If MsgBox("Toggle the grid?", vbOKCancel, "GridOn Example") = vbOK Then
viewportObj.GridOn = Not (viewportObj.GridOn)
Else
Exit Sub
End If
' Reset the active viewport to see the change
ThisDrawing.ActiveViewport = viewportObj
GoTo TOGGLEGRID
End SubVisual LISP:
(vl-load-com)
(defun c:Example_GridOn()
;; This example toggles the setting of GridOn.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Set the viewportObj variable to the activeviewport
(setq viewportObj (vla-get-ActiveViewport doc))
(vla-put-GridOn viewportObj (if (= (vla-get-GridOn viewportObj) :vlax-true) :vlax-false :vlax-true))
;; Reset the active viewport to see the change
(vla-put-ActiveViewport doc viewportObj)
(vla-Regen doc acAllViewports)
(alert "Toggled the display of the grid.")
)
Re: Apagar Grid en todos los Layout, viewports y model
Hola que tal, auhmm otra solución seria que en el archivo acad20xxdoc.lsp crees tus variables configuradas por ejemplo:
Y al final agreges esta linea
Espero sea de utilidas saludos.
- Código:
(defun LoadVarrillaSetup ()
(setvar "insunits" 6)
(setvar "filedia" 1)
(setvar "mbuttonpan" 1)
(setvar "highlight" 1)
(setvar "fillmode" 1)
(setvar "maxactvp" 50)
(setvar "pickadd" 1)
(setvar "pickfirst" 1)
(setvar "lwdisplay" 0)
(setvar "psltscale" 0)
(setvar "ltscale" 1)
(setvar "gridmode" 0)
(setvar "mirrtext" 0))
Y al final agreges esta linea
- Código:
(defun-q-list-set 'S::Startup (append (defun-q-list-ref 'S::Startup) '((LoadVarrillaSetup))))
(defun-q S::Startup nil (LoadVarrillaSetup))
Espero sea de utilidas saludos.
Re: Apagar Grid en todos los Layout, viewports y model
Hola muchachos como están.
Lo que tengo es que investigar como recorrer todos los viewports y por cada uno que lo apague.
de todas maneras voy a revisar y ver que aplico.
Muchas gracias.
Lo que tengo es que investigar como recorrer todos los viewports y por cada uno que lo apague.
de todas maneras voy a revisar y ver que aplico.
Muchas gracias.
carlosmgilp- Mensajes : 149
Fecha de inscripción : 17/03/2016
Edad : 42
Localización : Venezuela
Re: Apagar Grid en todos los Layout, viewports y model
Prueba a ver si te sirve utilizar este lisp con los dos comandos que pongo al final, grion y grioff
Evidentemente, su rapidez dependerá de la velocidad de regeneración de los layout ..
Un saludo
- Código:
(defun grid( i / old)
(setq old (mapcar 'getvar '(tilemode clayout)))
(mapcar '(lambda(a)(setvar 'clayout a)
;;; (mapcar 'setvar '(clayout gridmode)(list a i))
(if (> (length(vports)) i)
(progn
(command "_.mspace")
(foreach x (mapcar'(lambda(a)(list(car a)i))(vports))
(if (/= (car x) 1) (mapcar 'setvar '(cvport gridmode) x) )
)))
(command "_.pspace")(setvar 'gridmode i)
)(layoutlist))
(setvar 'tilemode 1)
(foreach x (mapcar'(lambda(a)(list(car a)i))(vports))(mapcar 'setvar '(cvport gridmode) x))
(mapcar 'setvar '(tilemode clayout) old)
)
(defun c:grion() (setvar 'cmdecho 0)(grid 1)(setvar 'cmdecho 1)(princ))
(defun c:grioff() (setvar 'cmdecho 0)(grid 0)(setvar 'cmdecho 1)(princ))
Evidentemente, su rapidez dependerá de la velocidad de regeneración de los layout ..
Un saludo
nolo- Mensajes : 182
Fecha de inscripción : 17/03/2016
Re: Apagar Grid en todos los Layout, viewports y model
Hola nolo como estas, disculpa la demora en responder, pues no tuve pc y se me complico todo.
Lo probare y cualquier cosa de ser necesario te comento.
Mil gracias y un saludo a todos.
Lo probare y cualquier cosa de ser necesario te comento.
Mil gracias y un saludo a todos.
carlosmgilp- Mensajes : 149
Fecha de inscripción : 17/03/2016
Edad : 42
Localización : Venezuela
Temas similares
» AYUDA CON TEMA DE VIEWPORTS EN LAYOUT
» Sumandome a este nuevo grupo
» AYUDA ACTIVAR LAYOUT CON VISUAL LISP
» Hola a todos me podriais ayudar con un lisp que detectara la interseccion de unas lineas con una polilinea?
» Pasar de varios vports a uno solo en model
» Sumandome a este nuevo grupo
» AYUDA ACTIVAR LAYOUT CON VISUAL LISP
» Hola a todos me podriais ayudar con un lisp que detectara la interseccion de unas lineas con una polilinea?
» Pasar de varios vports a uno solo en model
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.