Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to move a dimension feature inside a personal geodatabase using ArcObjects VBA. I was able to move other types of features using similar code as shown below. However it is not working for dimension features. Can someone help me on this?

Sub AdjustDimensionFeature()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pmap As IMap
Set pmap = pMxDoc.FocusMap

Dim pFtrLyr As IFeatureLayer
Set pFtrLyr = pmap.Layer(0)

Dim pFC As IFeatureClass
Set pFC = pFtrLyr.FeatureClass

Dim pFtr As IFeature
Set pFtr = pFC.GetFeature(8362)

Dim pTransform2D As ITransform2D
Dim pPolygon As IPolygon
Set pPolygon = pFtr.ShapeCopy

Set pTransform2D = pPolygon

pTransform2D.Move 20, 20

Set pFtr.Shape = pPolygon


End Sub
share|improve this question
found the answer myself.. – vinayan Mar 12 '12 at 16:44
found the answer myself.. used the dimensionshape property of idimensionfeature..transform BeginDimensionPoint,EndDimensionPoint and DimensionLinePoint..really finding hard to post the code as comment due to formatting :-( – vinayan Mar 12 '12 at 16:54
Post your solution as an answer. It's perfectly fine to answer your own question! – blah238 Mar 12 '12 at 18:28
up vote 2 down vote accepted

here is the solution which i found out..

Dim pDimFtr as IDimensionFeature
set pDimFtr = pFtr
Dim pDimShp As IDimensionShape
Set pDimShp = pDimFtr.DimensionShape

Dim pPtsColl As IPointCollection
Set pPtsColl = New Multipoint
pPtsColl.AddPoint pDimShp.BeginDimensionPoint
pPtsColl.AddPoint pDimShp.DimensionLinePoint
pPtsColl.AddPoint pDimShp.EndDimensionPoint
'pPtsColl.AddPoint pDimShp.TextPoint

Dim pTransform2D As ITransform2D
Dim pPolygon As IPolygon
Set pPolygon = pFtr.ShapeCopy

Set pTransform2D = pPtsColl

pTransform2D.Move 20, 20

Set pDimShp.BeginDimensionPoint = pPtsColl.Point(0)
Set pDimShp.DimensionLinePoint = pPtsColl.Point(1)
Set pDimShp.EndDimensionPoint = pPtsColl.Point(2)
'Set pDimShp.TextPoint = pPtsColl.Point(3)

pDimFtr.DimensionShape = pDimShp

share|improve this answer
3 years down, I face the same issue and woah!! – vinayan Jul 30 '15 at 13:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.