Stretching Dimensions via VBA
I'm trying to figure out how to "stretch" a dimension via Code. I've placed some objects and then dimensions. I want to be able to move those objects to a new location updating the dimensions as well. What happens is that the entire dimension moves not just the control pts @ the object. I've tried all sorts of selection set filter codes but no luck.
Code:
fcode(0) = -4: ftype(0) = "<and"
fcode(1) = -4: ftype(1) = "<or"
fcode(2) = 0: ftype(2) = "INSERT" ' block I want to move
fcode(3) = 0: ftype(3) = "Dimension" ' dimension(s) at the block location
fcode(4) = -4: ftype(4) = "or>"
fcode(5) = -4: ftype(5) = "<not"
fcode(6) = 14: ftype(6) = vupperright ' don't move one side of a dimension
fcode(7) = 13: ftype(7) = vupperleft ' don't move another side of a different dimension
fcode(8) = -4: ftype(8) = "not>"
fcode(9) = -4: ftype(9) = "and>"
This selection set here gives me an error about invalid procedure call
Here is the remaining code...if I just use the <or INSERT Dimension or> then
everything moves including the line
Code:
On Error Resume Next
ThisDrawing.SelectionSets.Item("HandleSelection").Delete
On Error GoTo 0
Set objss = ThisDrawing.SelectionSets.Add("HandleSelection")
objss.Select acSelectionSetCrossing, pt1, pt2, fcode, ftype
For Each objSelection In objss
objSelection.Move vOldPT, HandleLocPT
objSelection.Update
Next
Any ideas, work arounds....:banghead:
moving block and dimension
What I've done is create a application where a user builds his handle scheme via a VBA form. He then places that scheme in the drawing. The handles are dynamic blocks that are placed a calculated locations. I then dimension the "handle" locations. I'm wanting to allow the user to edit those locations later if need be. If the drawing changes by length or width then recalculations need to be done and then the handles need to move to the new locations. I've not be able to ps z e associate the dimension via VBA so I want to move the handles and have the dimension update. I can find the handle since it is a block.
I've attached the drawing to reflect what I'm talking. I look forward to your ideas.
getting the properties that need to be changed
Yea Tommy,
I think I need to get the right control points of the dimension to move but I can't seem to get my selection set correct. When I move pass
Code:
fcode(0) = -4: ftype(0) = "<or"
fcode(1) = 0: ftype(1) = "INSERT,"
fcode(2) = 0: ftype(2) = "Dimension"
fcode(3) = -4: ftype(3) = "or>"
Then I start getting invalid procedure call.
Code:
fcode(0) = -4: ftype(0) = "<and"
fcode(1) = -4: ftype(1) = "<or"
fcode(2) = 0: ftype(2) = "INSERT,"
fcode(3) = 0: ftype(3) = "Dimension"
fcode(4) = 100: ftype(4) = "Dimension"
fcode(5) = 2: ftype(5) = "*D"
fcode(6) = -4: ftype(6) = "or>"
fcode(7) = -4: ftype(7) = "<not"
fcode(8) = 13: ftype(8) = vupperleft
fcode(9) = 14: ftype(9) = vupperright
fcode(10) = -4: ftype(10) = "not>"
fcode(11) = -4: ftype(11) = "and>"
I know this isn't right but what I'm trying to do is grab the dimension then
exclude the points I don't want to move. This is what I need to do correct?
how do I get the ExtLine1Point & ExtLine2Point
are these exposed in VBA......do I search for them...could you provide a some code on what your thinking I'll change my code to reflect "insert,dimension" and see if I can get further. Thanks Tommy
Interesting I had to leave it @ 16
When I changed it to 17 I received an error but leaving @ 16 loaded alright.... Gotta love computers!
Now that I can get to the endpoints
Now that I can get to the end points How do I move them......Please understand that I am new to all this.
selecting the correct dimension
I do this based on the point where the handle block is. I'm needing to move that block and control pt to a new location without moving the other control point of the dimension.