.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Select Dimensions Inside a Block

0 REPLIES 0
Reply
Message 1 of 1
pellacad
239 Views, 0 Replies

How to Select Dimensions Inside a Block

I'm using VB.NET with ACAD 2008...

I need to change all the dimensions inside a block to be on the "Dim" layer...

I've got the block inserted and a refedit session started...but I'm running into a real roadblock compounded by brain freeze and serial senior moments...ANY HELP APPRECIATED!

Here's my code so far...

Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry

---SNIP---

objAcad.ActiveDocument.SendCommand("-layer make" & vbCr & (Microsoft.VisualBasic.Strings.Left(FileyWiley.Name, Len(FileyWiley.Name) - 4)) & vbCr & vbCr)
objAcad.ActiveDocument.SendCommand("-insert" & vbCr & (DXFInsertPath & "\" & FileyWiley.Name) & vbCr & InsPt1(0) & "," & InsPt1(1) & " 1 1 0 ")
objAcad.ActiveDocument.SendCommand("zoom object last ")

ExtMinpt = objAcad.ActiveDocument.GetVariable("ExtMIN")
ExtMaxpt = objAcad.ActiveDocument.GetVariable("ExtMAX")
dwgBound(0) = ExtMinpt(0)
dwgBound(1) = ExtMinpt(1)
dwgBound(2) = ExtMinpt(2)
dwgBound(3) = ExtMaxpt(0)
dwgBound(4) = ExtMaxpt(1)
dwgBound(5) = ExtMaxpt(2)

XAxisShift = ((ExtMaxpt(0) - ExtMinpt(0)) / 2)
objAcad.ActiveDocument.SendCommand("move last " & ExtMinpt(0) & "," & ExtMinpt(1) & vbCr & _
ExtMinpt(0) - XAxisShift & "," & ExtMinpt(1) & vbCr)
objAcad.ActiveDocument.SendCommand("zoom object last ")

objAcad.ActiveDocument.SendCommand("_refedit last ")
objAcad.AddAllowedClass(GetType(Dimension), False) '<--PROBLEM AREA NEEDS ATTENTION
objAcad.ActiveDocument.SendCommand("-layer ")
objAcad.ActiveDocument.SendCommand("refclose")

---SNIP---

I need some way to isolate just the dimensions into a selection set...I think. This might be a lot simpler than I think...

As you can tell from the code, it is way not sophisticated...but also, the code should be easily readable by even the earliest novice...

At any rate, I sure could use a hand!

Thanks in advance!

Pete
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost