Author Topic: Linetype scaling differs for unknown reason  (Read 588 times)

0 Members and 1 Guest are viewing this topic.


  • Mosquito
  • Posts: 4
Linetype scaling differs for unknown reason
« on: May 11, 2024, 10:43:45 AM »
I am using a c# plugin to do some changes to a file and then prepare a properly scaled viewport for plotting a png, then in a batch script I'm applying this to thousands of files with accoreconsole.exe where I load the file, apply the plugin, and plot.

On some files the linetypescaling isn't coming out as expected and I can't find the reason for this. LTSCALE and PSLTSCALE are the same on all files, what other settings should I be looking at?

edit: forgot to add, the linetype scaling is different after plotting from accoreconsole than it is after running the plugin in editor, that's another head scratcher for me, is it connected to the first issue? 
« Last Edit: May 11, 2024, 01:41:42 PM by damien_conroy »


  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2165
  • class keyThumper<T>:ILazy<T>
Re: Linetype scaling differs for unknown reason
« Reply #1 on: May 11, 2024, 04:23:26 PM »
Hi Damien,
We'd probably need to see the code you're using.

I assume you are saving the drawing after you make the changes ?

I haven't done any plotting to .png, so have no knowledge of pitfalls in that regard.


Is there any common factor for the files that fail to plot sucessfully ?
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.


  • Mosquito
  • Posts: 4
Re: Linetype scaling differs for unknown reason
« Reply #2 on: May 11, 2024, 04:54:21 PM »
the code is pretty sprawling/ugly so I wouldn't know what to include, and I think this might be more of an Autocad skills problem than coding skills problem.
Simplified process for plugin:
Cleanup and prep drawing
calculate size of plot
create layout, control the size by Viewport.ViewHeight (copy paste from Kean Walmsley)
do the plugin functionality, includes drawing some new polyline 2d

edit: found the solution, wasn't the code so I'm removing the code snippet, unsure of what I'm allowed to share. The problem was solved by erasing and reloading the linetypes, not sure of why that helped.
« Last Edit: May 12, 2024, 07:32:12 AM by damien_conroy »


  • Mosquito
  • Posts: 4
Re: Linetype scaling differs for unknown reason
« Reply #3 on: May 12, 2024, 03:00:28 PM »
Erasing the linetypes caused problems with the layers defaulting back to linetype continuous, so I just used the editor.command() for reloading linetypes.

adapted from
Code: [Select]
            if (bReload)
                //dataArry[0] = "-linetype Load Dashed\nacad.lin\nYes\n ";
                ed.Command("_.linetype", "Load", "Dashed", "acad.lin", "Yes", "");
                //dataArry[0] = "-linetype Load Dashed\nacad.lin\n ";
                ed.Command("_.linetype", "_Load", "_Dashed", "_acad.lin", "");