• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Active Member
    jparts
    Posts: 10
    Registered: ‎11-14-2011

    How does db.LoadMlineStyleFile work?

    203 Views, 6 Replies
    01-31-2012 12:27 AM

    Hello everybody,

     

    I'm pretty new to programming in .net so I really need your help with this problem:

     

    I'm trying to load a MLine Style from a local .mln file

     

    The Code is quiet simple, so maybe I'm forgetting something, but I have no idea what it is.

    When I run this code I get an "eFileAccessErr" error?!?

     

    Public Sub MLineStyleCreate(ByVal strName As String)

    Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument

    Dim dwg As Database = doc.Database

    Dim MLineStyleFile = "C:\Program Files\Autodesk\MarelAcadTools 2012\MarelMultiLines\beam.mln"

     

    dwg.LoadMlineStyleFile(strName, MLineStyleFile)

     

    End Sub

     Can somebody please help me with this?

    Your help will be very appreciated!

     

    Best regards,

     

    Joris

    Please use plain text.
    Valued Contributor
    Posts: 61
    Registered: ‎04-14-2010

    Re: How does db.LoadMlineStyleFile work?

    01-31-2012 01:50 AM in reply to: jparts
    Please use plain text.
    Active Member
    jparts
    Posts: 10
    Registered: ‎11-14-2011

    Re: How does db.LoadMlineStyleFile work?

    01-31-2012 03:09 AM in reply to: kob4lt

    Hi Kob4lt,

     

    Thanks for your help. I have added the wrapper to my code and updated it for AutoCAD 2012. The error message is now gone, BUT the MLINESTYLE still isn't loaded from the .mln file... AARGH, this really gives me a headache.

     

    Any suggestions?

     

    Thanks

    Please use plain text.
    Active Member
    jparts
    Posts: 10
    Registered: ‎11-14-2011

    Re: How does db.LoadMlineStyleFile work?

    01-31-2012 03:59 AM in reply to: jparts

    I was mistaken. The error still isn't gone. I just missed it, but it now appears on the autocad command line...

     

    So I still have a FileAccessErr Error. I have even moved the .mln file to "my documents" but still the same error appears.

     

    What am I doing wrong here???

     

    Edited by
    Discussion_Admin

     

     

    Please use plain text.
    Valued Contributor
    Posts: 61
    Registered: ‎04-14-2010

    Re: How does db.LoadMlineStyleFile work?

    01-31-2012 05:43 PM in reply to: jparts

    Maybe this can give you hint

     

    "Returns Acad::eFileAccessErr if the path or file name specified could not be opened for write"

     

    Do you have persmission to write to file? I know that you are only loading file, maybe autocad needs to write something in it

    Please use plain text.
    Active Member
    jparts
    Posts: 10
    Registered: ‎11-14-2011

    Re: How does db.LoadMlineStyleFile work?

    02-02-2012 04:51 AM in reply to: kob4lt

    Yes, I have full permission to the file. I can read and write it. If I use the command MLSTYLE in autocad i can load multilinestyles from that file, so to me it doesn't seem like autocad has a problem with the file...

    Please use plain text.
    Valued Contributor
    ro_fr
    Posts: 83
    Registered: ‎12-08-2011

    Re: How does db.LoadMlineStyleFile work?

    05-23-2013 08:13 AM in reply to: jparts

    Hi,

     

    I ran into the same error message and  ADN support found the cause. It seems that filename and stylename needs to be the same. Basically one style per mln file. I just checked the AC docs and it seems you can have more than one style in a mln file. But loading a style from a file containing  multiple styles didn't work for me (AC map 2013 sp1). Maybe this information  helps someone else as well,

     

    Rob

    Please use plain text.