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

How does db.LoadMlineStyleFile work?

6 REPLIES 6
Reply
Message 1 of 7
jparts
751 Views, 6 Replies

How does db.LoadMlineStyleFile work?

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

Tags (2)
6 REPLIES 6
Message 2 of 7
kob4lt
in reply to: jparts

Message 3 of 7
jparts
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

Message 4 of 7
jparts
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

 

 

Message 5 of 7
kob4lt
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

Message 6 of 7
jparts
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...

Message 7 of 7
hence_the_name
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

http://raumpatrouille3d.blogspot.ch/

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