.NET

Reply
Active Member
jparts
Posts: 10
Registered: ‎11-14-2011
Message 1 of 7 (340 Views)

How does db.LoadMlineStyleFile work?

340 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

Valued Contributor
kob4lt
Posts: 61
Registered: ‎04-14-2010
Message 2 of 7 (327 Views)

Re: How does db.LoadMlineStyleFile work?

01-31-2012 01:50 AM in reply to: jparts
Active Member
jparts
Posts: 10
Registered: ‎11-14-2011
Message 3 of 7 (324 Views)

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

Active Member
jparts
Posts: 10
Registered: ‎11-14-2011
Message 4 of 7 (321 Views)

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

 

 

Valued Contributor
kob4lt
Posts: 61
Registered: ‎04-14-2010
Message 5 of 7 (304 Views)

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

Active Member
jparts
Posts: 10
Registered: ‎11-14-2011
Message 6 of 7 (283 Views)

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...

Mentor
Robert_Fritz
Posts: 162
Registered: ‎12-08-2011
Message 7 of 7 (161 Views)

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

http://raumpatrouille3d.blogspot.ch/

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community