Add dimension to shape automatically

T

Tomislav

Hello,

How to attach dimension lines to a shape, so that they are visible when
object
is dropped on the sheet ?

For example, I found some architectural shapes which have dimension
visible when they are dropped on sheet, but I did not manage to do that
with other shapes.

Any ideas ?

Thanks,

Tomislav
 
J

JuneTheSecond

An example to add horizontal dimension to a rectangular might be like ,,
Sub makeRectDim()
Dim myrect As Visio.Shape
Dim docStn As Visio.Document
Dim mstDim As Visio.Master
Dim dimHor As Visio.Master
Dim dimVert As Visio.Master
Dim shpDimHor As Visio.Shape
Dim shpdimVert As Visio.Shape

Set docStn = Application.Documents.OpenEx("C:\Program Files\Microsoft
Office\Visio11\1041\DIMENG_M.VSS", visOpenRO + visOpenDocked)
Set myrect = ActivePage.DrawRectangle(3, 6, 5, 8)
For Each mstDim In docStn.Masters
Debug.Print mstDim.ID, mstDim.Name, mstDim.NameU
Next
Set dimHor = docStn.Masters.ItemFromID(3)
Set shpDimHor = ActivePage.Drop(dimHor, 3, 8)
shpDimHor.Cells("BeginX") = 3
shpDimHor.Cells("BeginY") = 8
shpDimHor.Cells("EndX") = 5
shpDimHor.Cells("EndY") = 8
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top