turn off Shape Protection

Started by dtallent, February 07, 2017, 06:16:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtallent

I am thinking shape protection is my issue. The file I attached is a set of sidewalks on a plot plan for one of our properties. Some of the sidewalks are wrong or have moved. How do I unlock this so I can change them around? Thanks.

wapperdude

Can you upload vsd file?

Wapperdude
Visio 2019 Pro

Nikolay

#2
There is no protection on your shape.
It is just your whole drawing is now one single complex shape, containing many geometries (lines).
You can just select the "Line" tool and start moving the lines/vertexes around the way you want.
If creating a single complex shape was not your intent, then you can split it into separate shapes/lines using "trim" command for example.

wapperdude

Was this an imported image and not drawn with Visio shapes?

Wapperdude
Visio 2019 Pro

dtallent

Attached is the file I am trying to unlock. The attached file is a set of sidewalks for one o four properties. A previous employee created them and locked the sidewalks together. I am trying to find out how to unlock them so I can move them around without having to trace a new line over each line.

wapperdude

Can you upload vs version?

Wapperdude
Visio 2019 Pro

dtallent

The attached is the same section only I ended up laying a new line over each and deleting the goofy thing.

wapperdude

Sorry, had a typo...vsd file, not vsdx.

Visio 2019 Pro

dtallent

Ok how do I change it to a vsd? Everything I try saves it with an x.

dtallent


Croc

dtallent,
Such macro will cut shape on separate lines.

Sub ttt()
    Dim sh1 As Visio.Shape, sh2 As Visio.Shape
    Set sh1 = ActivePage.Shapes(1)
    Set sh2 = sh1.Duplicate
    sh2.Cells("PinX") = sh1.Cells("PinX")
    sh2.Cells("PinY") = sh1.Cells("PinY")
    ActiveWindow.SelectAll
    ActiveWindow.Selection.Trim
    n = ActivePage.Shapes.Count
    For i = n To n / 2 + 1 Step -1
        ActivePage.Shapes(i).Delete
    Next
End Sub

dtallent

Not to sound like an idiot, but can you break this down into some instructions. Do I need to type this somewhere and if so where. This is all Greek to me, but thanks for the help. I opened the attachment and it is exactly what I am trying to do.


Quote from: Croc on February 22, 2017, 02:08:07 PM
dtallent,
Such macro will cut shape on separate lines.

Sub ttt()
    Dim sh1 As Visio.Shape, sh2 As Visio.Shape
    Set sh1 = ActivePage.Shapes(1)
    Set sh2 = sh1.Duplicate
    sh2.Cells("PinX") = sh1.Cells("PinX")
    sh2.Cells("PinY") = sh1.Cells("PinY")
    ActiveWindow.SelectAll
    ActiveWindow.Selection.Trim
    n = ActivePage.Shapes.Count
    For i = n To n / 2 + 1 Step -1
        ActivePage.Shapes(i).Delete
    Next
End Sub


Croc

I sent a file that already have this macro.
This file can be used as a tool.
To break up a complex shape on the lines, do the following:
1. Remove all the shapes from the file "... trimmed."
2. Copy the complex shape on a page of file "... trimmed."
3. Press Alt + F8 and run the macro "ttt".
4. Copy the result into desired location.

dtallent

I guess now I want to be difficult. Is there a way to run this without removing the shape from the file. For example, this was one set of sidewalks from a plot plan. I may have 10 or so on each plan I need to unlock.

Croc

I've updated the macro.
This macro should trim the selected shape. Only one selected shape.
If a drawing has few such shapes, it is necessary to perform the macro several times.
A macro can be called from another document.

Sub ttt()
    Dim sh1 As Visio.Shape, sh2 As Visio.Shape
    Set sh1 = ActiveWindow.Selection(1)
    Set sh2 = sh1.Duplicate
    MaxInd = sh2.Index
    sh2.Cells("PinX") = sh1.Cells("PinX")
    sh2.Cells("PinY") = sh1.Cells("PinY")
    ActiveWindow.DeselectAll
    ActiveWindow.Select sh1, visSelect
    ActiveWindow.Select sh2, visSelect
    ActiveWindow.Selection.Trim
    MaxInd2 = ActivePage.Shapes.Count
    n = (MaxInd2 - MaxInd) \ 2
    For i = MaxInd2 To MaxInd2 - n Step -1
        ActivePage.Shapes(i).Delete
    Next
End Sub


I tested the macro not enough. Use it carefully.