Protege Formas en Visio

Las propiedades LockAspect, LockBegin, LockCalcWH, LockCrop, LockCustProp, LockDelete, LockEnd, LockFormat, LockFromGroupFormat, LockGroup, LockHeight, LockMoveX, LockMoveY, LockRotate, LockSelect, LockTextEdit, LockThemeColors, LockThemeEffects, LockVtxEdit y LockWidth expuestas por la clase Protection admiten el objeto Aspose.Diagram.BoolValue . Estas propiedades se pueden utilizar para proteger/desproteger formas.

En Visio, debe realizar las siguientes acciones para proteger cualquier forma:

  • Abierto diagram en MS Visio
  • Seleccione cualquier forma
  • Seleccione ‘Protección…’ en el menú ‘Formato’ si está usando Visio 2007 o seleccione ‘Protección’ en el menú ‘Desarrollador’ si está usando Visio 2010
  • En la ventana ‘Protección’, marque/desmarque cualquier cuadro de texto para bloquear o desbloquear cualquier atributo de forma
  • Presiona OK'

Use el siguiente código en su aplicación .NET para hacer lo mismo (bloquear cualquier atributo de forma) usando Aspose.Diagram for .NET.

 //Load diagram

Diagram diagram = new Diagram("ProtectShape.vsd");

Page page0 = diagram.Pages[0];

Shape shape = page0.Shapes[0];

shape.Protection.LockAspect.Value = BOOL.True;

shape.Protection.LockBegin.Value = BOOL.True;

shape.Protection.LockCalcWH.Value = BOOL.True;

shape.Protection.LockCrop.Value = BOOL.True;

shape.Protection.LockCustProp.Value = BOOL.True;

shape.Protection.LockDelete.Value = BOOL.True;

shape.Protection.LockEnd.Value = BOOL.True;

shape.Protection.LockFormat.Value = BOOL.True;

shape.Protection.LockFromGroupFormat.Value = BOOL.True;

shape.Protection.LockGroup.Value = BOOL.True;

shape.Protection.LockHeight.Value = BOOL.True;

shape.Protection.LockMoveX.Value = BOOL.True;

shape.Protection.LockMoveY.Value = BOOL.True;

shape.Protection.LockRotate.Value = BOOL.True;

shape.Protection.LockSelect.Value = BOOL.True;

shape.Protection.LockTextEdit.Value = BOOL.True;

shape.Protection.LockThemeColors.Value = BOOL.True;

shape.Protection.LockThemeEffects.Value = BOOL.True;

shape.Protection.LockVtxEdit.Value = BOOL.True;

shape.Protection.LockWidth.Value = BOOL.True;

diagram.Save("ProtectedShapesFile.vdx", SaveFileFormat.VDX);

Descargar código de muestra