TheSwamp

Code Red => .NET => Topic started by: samideqlqpart on December 25, 2016, 02:31:04 AM

Title: Closed filled arrowhead bug
Post by: samideqlqpart on December 25, 2016, 02:31:04 AM
Hello and happy new year
when i ran my program i got this message

eInvalidInput
at
Autodesk.AutoCAD.ApplicationServices.Core.Application.SetSystemVariable(String name, Object value)
at this line
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMBLK", "_Closedfilled")

but it's happened only with the closed filled arrow and works well with ALL other types of the arrowhead
like  _Dot, _Closedblank,.......

here is the code


                ' Make the arrow head as _Closedfilled.

                Dim mldstyle As New MLeaderStyle()

                Dim blockTable As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForRead)
                If (Not blockTable.Has("_Closedfilled")) Then
                    ' load the "_DOT" block definition
                    Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMBLK", "_Closedfilled")
                End If

                mldstyle.ArrowSymbolId = blockTable("_Closedfilled")

How to fix it?
and if the answer is to load it at the begin, then how to do it?
i'm needing helps

thank you





Title: Re: Closed filled arrowhead bug
Post by: kdub_nz on December 25, 2016, 03:41:34 AM

Have a look here :
https://www.theswamp.org/index.php?topic=50998.msg561326#msg561326
Title: Re: Closed filled arrowhead bug
Post by: samideqlqpart on December 25, 2016, 03:51:32 AM
ok  :smitten:
Title: Re: Closed filled arrowhead bug
Post by: samideqlqpart on December 27, 2016, 03:03:35 AM
the problem is solved
thank you
is there something about Leader (Qleader)
the same thing
Oblique for arrowhead is chosen by defaults
how to set it to CLosed filled?
Title: Re: Closed filled arrowhead bug
Post by: kdub_nz on December 27, 2016, 03:54:19 AM
What does this do for you ?
Code: [Select]
Command:
DIMBLK
Enter new value for DIMBLK, or . for default <"">:



and the matching instruction in code
something like :
Code - C#: [Select]
  1.  
  2.             arrowName = (string)AcadApp.GetSystemVariable("DIMBLK");
  3.             ed.WriteMessage($"\nDIMBLK is: {arrowName} \nID is: {db.Dimblk}\n");
  4.  
  5.             // Set to default 'Closed filled'
  6.             db.Dimblk = ObjectId.Null;
  7.  
  8.             arrowName = (string)AcadApp.GetSystemVariable("DIMBLK");
  9.             ed.WriteMessage($"\nDIMBLK is: {arrowName} \nID is: {db.Dimblk}\n");
  10.  
  11.  

Title: Re: Closed filled arrowhead bug
Post by: samideqlqpart on December 27, 2016, 04:53:22 PM
hi!
that's what i need
thank you very much