runtime error

runtime error

Anonymous
Not applicable
402 Views
4 Replies
Message 1 of 5

runtime error

Anonymous
Not applicable
why is this:
ThisDrawing.SetVariable "DIMLDRBLK", ""
giving me:
Runtime error '-2145320858 (80210066)',
Error Setting System Variable

??
0 Likes
403 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Sub test()
ThisDrawing.SetVariable "DIMLDRBLK", ""
MsgBox "works great!"
End Sub

works ok for me.
-Josh

David Donnell wrote:

> why is this:
> ThisDrawing.SetVariable "DIMLDRBLK", ""
> giving me:
> Runtime error '-2145320858 (80210066)',
> Error Setting System Variable
>
> ??
0 Likes
Message 3 of 5

Anonymous
Not applicable
That really has me puzzled now its working there fine but bombing in the
For Each objDim In objSelSet as type mismatch! ( I posted to our earlier
posts)

"Minkwitz Design" wrote in message
news:[email protected]...
> Sub test()
> ThisDrawing.SetVariable "DIMLDRBLK", ""
> MsgBox "works great!"
> End Sub
>
> works ok for me.
> -Josh
>
> David Donnell wrote:
>
> > why is this:
> > ThisDrawing.SetVariable "DIMLDRBLK", ""
> > giving me:
> > Runtime error '-2145320858 (80210066)',
> > Error Setting System Variable
> >
> > ??
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
It's most likely that the loop is running across something in the set that's
not of the same type declaration as "objDim". You may want to loop the
filtered set and check the type of each acadentity, then throw up a message
box when something's there that's not supposed to be, just for our benefit.

where dim Ent as acadentity:

for each ent in objSelSet
if typeof ent is acadleader then
'do your thing
else
msgbox "this entity in the set is a " & ent.objectname
end if
next

David Donnell wrote:

> That really has me puzzled now its working there fine but bombing in the
> For Each objDim In objSelSet as type mismatch! ( I posted to our earlier
> posts)
>
> "Minkwitz Design" wrote in message
> news:[email protected]...
> > Sub test()
> > ThisDrawing.SetVariable "DIMLDRBLK", ""
> > MsgBox "works great!"
> > End Sub
> >
> > works ok for me.
> > -Josh
> >
> > David Donnell wrote:
> >
> > > why is this:
> > > ThisDrawing.SetVariable "DIMLDRBLK", ""
> > > giving me:
> > > Runtime error '-2145320858 (80210066)',
> > > Error Setting System Variable
> > >
> > > ??
> >
0 Likes
Message 5 of 5

Anonymous
Not applicable
Josh, I did as you suggested and the message came back as 2 things:
acDbBlockReference and AcDbLine.. I tried to remove those from the selection
set but it won't let me; also that stupid DIMLDRBLK is still erroring
objSelSet.RemoveItems (objEnt)
not supported
objSelSet.RemoveItems (AcadBlockReference) < error not
supported

Private Sub DimHardSet(dblDwgDimScale As Double)
'declarations
Dim ExistDimStyles As AcadDimStyles
Dim currDimStyle As AcadDimStyle
Dim newDimStyle As AcadDimStyle
Dim objSelSets As AcadSelectionSets
Dim objSelSet As AcadSelectionSet
Dim objDim As AcadDimension
Dim objEnt As AcadEntity
Dim intType(0) As Integer
Dim varData(0) As Variant
Dim strStyleName As String
Dim StandardExists As Boolean
Dim Leadr As AcadLeader

'if the active style isn't standard then,,,,
If UCase(ThisDrawing.ActiveDimStyle.Name) <> "STANDARD" Then
'search for the standard style and make it the active style
For Each newDimStyle In ThisDrawing.DimStyles
If UCase(newDimStyle.Name) = "STANDARD" Then
ThisDrawing.ActiveDimStyle = newDimStyle
StandardExists = True
End If
Next
'if it's not in the collection and it didn't get set, create it
If Not StandardExists Then
Set newDimStyle = ThisDrawing.DimStyles.Add("STANDARD")
ThisDrawing.ActiveDimStyle = newDimStyle
End If
End If

'set the variables for the active style
ThisDrawing.SetVariable "DIMASZ", 0.09375
ThisDrawing.SetVariable "DIMATFIT", 3
ThisDrawing.SetVariable "DIMAUNIT", 0
ThisDrawing.SetVariable "DIMAZIN", 0
'ThisDrawing.SetVariable "DIMBLK", "_ArchTick"
ThisDrawing.SetVariable "DIMBLK1", "_ArchTick"
ThisDrawing.SetVariable "DIMBLK2", "_ArchTick"
'ThisDrawing.SetVariable "DIMLDRBLK", "" <<<<<<<<<<<<<<<
erroring!
ThisDrawing.SetVariable "DIMCEN", 0
ThisDrawing.SetVariable "DIMCLRD", 1
'ThisDrawing.SetVariable "DIMCLRT", BYLAYER)
ThisDrawing.SetVariable "DIMDLE", 0.09375
ThisDrawing.SetVariable "DIMDLI", 0.375
ThisDrawing.SetVariable "DIMEXE", 0.09375
ThisDrawing.SetVariable "DIMEXO", 0.0625
ThisDrawing.SetVariable "DIMFRAC", 0
ThisDrawing.SetVariable "DIMGAP", 0.09375
ThisDrawing.SetVariable "DIMJUST", 0
'ThisDrawing.SetVariable "DIMLFAC", 1.00000
ThisDrawing.SetVariable "DIMLIM", 0
ThisDrawing.SetVariable "DIMLUNIT", 4
ThisDrawing.SetVariable "DIMLWD", -1
ThisDrawing.SetVariable "DIMLWE", -1
ThisDrawing.SetVariable "DIMRND", 0
ThisDrawing.SetVariable "DIMSAH", 1
'ThisDrawing.SetVariable "DIMSCALE", dblDwgDimScale
ThisDrawing.SetVariable "DIMSD1", 0
ThisDrawing.SetVariable "DIMSD2", 0
ThisDrawing.SetVariable "DIMSE1", 0
ThisDrawing.SetVariable "DIMSE2", 0
ThisDrawing.SetVariable "DIMSOXD", 0
ThisDrawing.SetVariable "DIMTAD", 1
ThisDrawing.SetVariable "DIMTIH", 0
ThisDrawing.SetVariable "DIMTIX", 0
ThisDrawing.SetVariable "DIMTMOVE", 2
ThisDrawing.SetVariable "DIMTOFL", 1
ThisDrawing.SetVariable "DIMTOH", 0
ThisDrawing.SetVariable "DIMTSZ", 0
ThisDrawing.SetVariable "DIMTVP", 0
ThisDrawing.SetVariable "DIMTXSTY", "Standard"
ThisDrawing.SetVariable "DIMTXT", 0.09375
ThisDrawing.SetVariable "DIMUPT", 0
ThisDrawing.SetVariable "DIMZIN", 11

'create the first sset
Set objSelSet = ThisDrawing.SelectionSets.Add("dimensions")
intType(0) = 2
varData(0) = "DIMENSION"
objSelSet.Select acSelectionSetAll, intType, varData

For Each objEnt In objSelSet
If TypeOf objEnt Is AcadDimension Then <<<<<<<<<
mismatch
'update it to the new style
If objSelSet.Count > 0 Then
For Each objDim In objSelSet
objDim.StyleName = "STANDARD"
objDim.Update
Next
End If

ElseIf TypeOf objEnt Is AcadLeader Then
'update the filter, clear the original set, use it again for leaders
objSelSet.Clear
intType(0) = 2
varData(0) = "LEADER"
objSelSet.Select acSelectionSetAll, intType, varData

'reiterate the set using "for each leader"
If objSelSet.Count > 0 Then
For Each Leadr In objSelSet
Leadr.StyleName = "STANDARD"
Leadr.Update
Next
End If
Else
objSelSet.Delete
<<<<<<<<<<
'objSelSet.RemoveItems (objEnt)
'objSelSet.RemoveItems (AcadBlockReference)
'MsgBox "this entity in the set is a " & objEnt.ObjectName
End If
'Next <<<<<<<<<<<<<<<
'delete selection set
'objSelSet.Delete <<<<<<<<<<<<<<
Next
'purge old dimstyles
PurgeDimS

"Minkwitz Design" wrote in message
news:[email protected]...
> It's most likely that the loop is running across something in the set
that's
> not of the same type declaration as "objDim". You may want to loop the
> filtered set and check the type of each acadentity, then throw up a
message
> box when something's there that's not supposed to be, just for our
benefit.
>
> where dim Ent as acadentity:
>
> for each ent in objSelSet
> if typeof ent is acadleader then
> 'do your thing
> else
> msgbox "this entity in the set is a " & ent.objectname
> end if
> next
>
> David Donnell wrote:
>
> > That really has me puzzled now its working there fine but bombing in the
> > For Each objDim In objSelSet as type mismatch! ( I posted to our earlier
> > posts)
> >
> > "Minkwitz Design" wrote in message
> > news:[email protected]...
> > > Sub test()
> > > ThisDrawing.SetVariable "DIMLDRBLK", ""
> > > MsgBox "works great!"
> > > End Sub
> > >
> > > works ok for me.
> > > -Josh
> > >
> > > David Donnell wrote:
> > >
> > > > why is this:
> > > > ThisDrawing.SetVariable "DIMLDRBLK", ""
> > > > giving me:
> > > > Runtime error '-2145320858 (80210066)',
> > > > Error Setting System Variable
> > > >
> > > > ??
> > >
>
0 Likes