Line styles, multiline styles from MicroStation (OpenSite)

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Hoff
Newbie Member
Posts: 4
Joined: Fri Sep 12, 2025 2:09 pm

Line styles, multiline styles from MicroStation (OpenSite)

Post by Hoff » Tue Sep 16, 2025 12:05 pm

Operating system: Windows 10
QZAD version: QCAD Professional 3.32.4 for Windows 64bit (ZIP Archive)

First Issue: Can I get multi line styles from Microstation (Open Site) to be displayed properly in QCAD?

Second issue: How do I get line stales from Microstation (Open Site) to display properly? I’m guessing I need proper global linetype scale. How do I figure out that number.
What do I do if I have line styles with different scales in Misrostation? From what I can see linetype Scale doesn’t import from Microstation to QCAD (it’s 1 by default) or does it?

Kind Regards
Hoff
Attachments
line type.dwg
(215.81 KiB) Downloaded 337 times
line style QCAD.jpg
line style QCAD.jpg (189.92 KiB) Viewed 19681 times
line style Open Site.jpg
line style Open Site.jpg (200.98 KiB) Viewed 19681 times
Last edited by Hoff on Wed Sep 17, 2025 10:17 am, edited 3 times in total.

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Tue Sep 16, 2025 2:12 pm

Hi, and welcome to the QCAD forum.

It seems that Linetypes are handled a bit different in MicroStation and special custom patterns are not readily supported.
Referring to this link, it can be fixed within limits at the MicroStation side.
The biggest issue is probably screen or pixel based versus drawing unit based.

QCAD also uses a hybrid method based on pixels when Screen-based Linetypes (NL) is active.
In your screen capture that seems to be inactive.
Typically turned off for a page layout, then the pattern is drawing unit based.

Seems that AutoCAD might support them better if the RSC linetype file folder path is added to the 'Support File Search Path'.
Also meaning that you might need a copy of those RSC files.


QCAD Linetypes are stored in a *.lin file, the analogue for SHX shape files is CXF.
But many things are simply not supported and may simply be dropped.


QCAD supports reading DGN V8 (Microstation) but it is not stated to which extend.
Probably limited to main geometry.

Regards,
CVH

Hoff
Newbie Member
Posts: 4
Joined: Fri Sep 12, 2025 2:09 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by Hoff » Wed Sep 17, 2025 12:34 pm

Hi, wecome and thank you for replying to my issues.

I’ll focus on linestyles that get recognized by QCAD. The rest of them I’ll drop in OpenSite to simple graphic.
QCAD managed to recognize some of my linestyles and it recognized linetype scale as well. To have those lines visible in QCAD in more or less correct scale I had to set global linetype scale to 39.
My question is why 39? Where does this number come from?
When I save the file in QCAD with scale 39 after reopening that file linestyles are not presenting in a correct way. Scale is distorted.

I also do not understand scale of linetypes matches the scale of each viewport box. No mather if I check it or not results seem to be the same.

Kind Regards
Hoff
Attachments
opensite dwg.jpg
opensite dwg.jpg (105.72 KiB) Viewed 19564 times
QCAD.jpg
QCAD.jpg (199.23 KiB) Viewed 19564 times
QCAD reopen.jpg
QCAD reopen.jpg (114.9 KiB) Viewed 19564 times

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Wed Sep 17, 2025 8:51 pm

Hoff wrote:
Wed Sep 17, 2025 12:34 pm
I also do not understand scale of linetypes matches the scale of each viewport box. No mather if I check it or not results seem to be the same.
Let us first get rid of some terminology issues.
A) The QCAD GUI can display up to 4 Viewports: See Drawing Preference .. Layout .. Viewports.
-> See that as 1-4 independent viewing areas on the content in Model_Space.
-> Each GUI Viewport has a left-lower position, a viewable area and a zoom state or scale.
-> Only one is the active GUI Viewport at any time.

B) On a Layout Block one can add one to more Viewports.
-> See those as a limited representation of a rectangular area from some content in Model_Space.
-> Each Viewport object has a defined area to show as cropped in a certain paper scale.
-> The visibility of objects depends on Layer and/or Block visibility.

The terms 'Layout' and 'Viewport' have a completely different purpose but are a bit similar in what they represent.
A) Is related to how things are presented in the QCAD GUI ... How the widgets layout is on the screen.
B) Layout Blocks are related to how things will be presented on paper, as a hard copy or as a virtual page in a PDF export.

Because several Viewport objects in a Layout Block may use a different scale on paper, the scale of the Linetype can be set to match that.
Just as you discovered: This drawing preference has no influence on the representation in Model view.
Under QCAD, Model_Space has no paper scale and you cannot create a Viewport in Model_Space.


In the mean time QCAD has stored an Autosave copy of your file as DXF.
I added a line using the custom Linetype "02_302_DS|5_OTKJ". (Seen in QCAD.jpg)
I can now look that up textually there DWG is a binary format with little to no references.
  • Group code 72 = Alignment code; value is always 65, the ASCII code for A
    Group code 73 = The number of linetype elements: 2
    Group code 40 = Total pattern length: 2.0
    Group code 49 = Dash, dot or space length (one entry per element): 1.5
    Group code 74 = Complex linetype element type (one per element). Default is 0
    Group code 49 = Dash, dot or space length (one entry per element): -0.5
    Group code 74 = Complex linetype element type (one per element). Default is 0

    In lin format that would be: A, 1.5, -0.5
    A dash 1.5 long followed by a space 0.5 long, repeated indefinitely
Sounds simple and everything seems OK, but now we're venturing on slippery ice. :roll:

It is said that the lengths are expressed in drawing units.
In the case of the given example file line type.dxf that would be the unit 'Meters'


Not using Screen-based Linetypes, a line that is 73.51731304 units long should be represented by about 36-37 dashes.
:arrow: IT IS NOT :!:
When I scale the pattern up by factor 100, I can count 15 dashes.
Each about 3.81 units long with a spacing of about 1.27 units long, summing to about 5.08 units.
(3.81 units long except for the first and the last dash)

Then this tends to fit: pattern length * 100 / 39 = 5.13 (in units)
And perhaps with this too: 2 / 0.38686284(*) = 5.17 (*) See lower
Although, I did measure them up rather exact ... e.g. 4 patterns span 20.31998682... units, end to end.

The Math would fit in other occasions without a correction factor.


A common advice given for drawings in meters is to set a global Linetype scale of 1000 ...
... That would display not 15 but 15/10= 1.5 dashes or 2 partials at both ends, and it does.

Everyone knows that 1000 mm is 1 meter ...
Suggesting that metric patterns are defined in mm to be scaled up to meters.
While imperial patterns are coded 25.4 times smaller and thus in inches.
That doesn't comply with what is summarized in the above link "It is said that ..."

But it tends to fit with what we can discover in files generated by QCAD and several other applications except yours.


Not that it makes any sense to me at the moment ...
... Model_Space has an associated Layout (Block) called 'Model'.
With Application Preferences .. Widgets .. Property Editor .. Display properties of current Block and Layers set to active.
With nothing selected choosing in the Property Editor .. Selection field (All [2]) the entry 'Layout [1]'
-> Use Standard Scale is reported as Yes
-> Standard Scale is reported as 0.38686284 (*)
What is the same as under Custom Scale: 1 over 2.58489546

From the above we can deduct that the Linetype scale would be 2.54 or 0.39370... in inverse
But then for patterns lengths in Drawing units instead of mm or inch.
The rest doesn't really comply either.
Your drawing specifies paper ISO A4, not ANSI_A_(8.50_x_11.00_Inches)
Plot Margins don't correlate with page settings
And so on.

For a new file created with QCAD the Layout 'Model' seems to hold default information, mostly 'No', zero and so on.
After reloaded the file that becomes partially bogus.
For example, the Media name is 'Letter_(8.50_x_11.00_Inches)' after reloading ...
... What is odd for a metric drawing using A4 by default.

Unsure if or to what extend this 'Model' properties are used by QCAD.
But seemingly they affect the representation in your case.


Perhaps you could enter a Bug Report or request for a better Linetype support for DWG files created with MicroStation.
See QDAD Bugtracker

Regards,
CVH

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Thu Sep 18, 2025 6:39 am

Hi,

It was kinda in my reply but the issue was not obvious enough.
CVH wrote:
Wed Sep 17, 2025 8:51 pm
From the above we can deduct that the Linetype scale would be 2.54
Your drawing unit is 'Meter', paper unit is 'Millimeter' but your Measurement system is set to 'Imperial'.
Changing the Measurement system to 'Metric' has no immediate effect. (The culprit)

:arrow: After a reload it all starts to make more sense.

## All taken for granted that Linetypes patterns are NOT in drawing units but that they are expressed in millimeter or in inch ##

Using the Measurement system 'Metric' the pattern '02_302_DS|5_OTKJ' of 2.0 long is regarded by QCAD as 2.0 mm long.
Following the common advice for drawings in meters set the Global Linetype scale to 1000 making the pattern 2000 mm long.

Referring to the above screen capture 'QCAD.jpg':
For a line 73.51731304 units long using Linetype '02_302_DS|5_OTKJ' with custom Linetype scale 3 we may expect:
73.51731304 m / (2.0 mm * 1000 * 3) = 12.253 patterns or distributed (Type A) as 13 dashes.

Then the representation in QCAD not using Screen-based Linetypes matches with the capture 'opensite dwg.jpg'


The Global Linetype scale of 39 makes sense with imperial patterns:
73.51731304 m / (2.0 inch * 39 * 3) = 12.369 patterns or distributed as 13 dashes.

The ideal global factor would be 39.37007874015748 :wink:
The preference input field accepts expressions like: 1000/25.4


If considered as solved, please add [SOLVED] to the title of your initial post by editing it.

Regards,
CVH

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Thu Sep 18, 2025 10:02 am

Kinda an amazing but also a very slow drawing file for 4 patterned lines. :lol:
215.81 Kb as DWG ... 1.19 Mb as DXF.

3 unused Blocks and 3502 :!: unused layers, the content was probably removed for its purpose.
About an endless list of Linetypes with many duplicates.

All these layers may have had a purpose but how do you accomplish to activate the correct layer to draw on?
It seems that there is a layer for every detail.
Then part of layer names also correlates with Linetypes designators.
They may even be arranged in an hierarchical layer tree.

Regards,
CVH

Hoff
Newbie Member
Posts: 4
Joined: Fri Sep 12, 2025 2:09 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by Hoff » Fri Sep 19, 2025 12:50 pm

Hi,
I use Qcad to create map tiles from files that I receive from Designers. I cleaned the file from its content to represent my issues on a couple of example lines. I guess I didn’t clean it really well considering empty layers and other rubbish, by the way I don’t see those leyers in OpenSite.

Thanks for all replies. Now I understand how linetype scale factor works. I had problems mainly because of the fact that changing measurement system to metric doesn’t affect the file immediately. After changing it to metric and reopening the file all I had to do is set Global linetype scale to 1000. Lines represent the way they should.

Now I would like to find out how to detect mor or less automatically linetypes that do not get recognized by QCAD. Does QCAD provide any bug report on linetypes? Once I’m able to detect those linetypes I will be able to drop them into simple elements in microstation. The less linetypes I have to break the smaller file size I’ll get.

I’ve noticed that QCAD can recognize some of complex linstyles from my file (ex. 02_896_MOP-Lomna-Las-BP_szary|CP, 02_931_S_KD_A|sciek2). Is there any way of finding out why just them? If It can do it with them I guess it may be possible with others.

Retgards
Hoff
Attachments
opensite.jpg
opensite.jpg (159.83 KiB) Viewed 19203 times
QCAD2.jpg
QCAD2.jpg (165.46 KiB) Viewed 19203 times
leyers.jpg
leyers.jpg (64.6 KiB) Viewed 19203 times
line type 2.dwg
(223.03 KiB) Downloaded 332 times

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Fri Sep 19, 2025 3:21 pm

Hi,

Please start a new post for unrelated questions.
That makes the forum a bit searchable on topic. :wink:
Hoff wrote:
Fri Sep 19, 2025 12:50 pm
Now I would like to find out how to detect more or less automatically linetypes that do not get recognized by QCAD.
Kinda related ...
First problem is that DWG support under QCAD is handled by the Open Design libraries (ODA).
If you look that up in detail, it is based on reverse engineering.
The DWG format is proprietary and little to no information is shared publicly.

It is unsure what the Open Design libraries return for MicroStation native Linetypes.
Perhaps it simply drops unsupported things silently.
You could attempt to stream all debug output to a log file, search the forum on that.

Even the 'well-documented' textual DXF format has some mystical aspects that troubles software designers (See ezdxf developers discussions)


In one of the earlier provided links is explained what to do at the MicroStation side when saving a DGN as DWG.
The issues would be the use of:
Complex geometry (splines, cells, etc.), different spacing, dash widths, tapering, and other options available for MicroStation line styles.

Another issue might be the use of certain shapes stored in a SHX file.
QCAD uses an analog stored in CXF files, references to SHX shapes are looked up in a CXF file with the same name.
Chances are that such a CXF doesn't exists on your system or that a shape has no definition in a matching CXF.


'02_896_MOP-Lomna-Las-BP_szary|CP' or '02_931_S_KD_A|sciek2' are probably a variant of a Linetype in the lin format.
Similar to the Linetype '02_302_DS|5_OTKJ' that I looked up.

I think that what comes after the vertical bar correlates with some Linetype definition.
For example:
  • A_02_201_wCzosnow|ACAD_ISO12W100
    A_02_201_wCzosnow|DASHED2
    02_201_wCzosnow|ACAD_ISO03W100
    02_201_wCzosnow|DASHED2
A_02_201_wCzosnow or 02_201_wCzosnow seems to correlate with a set of layers or MicroStation levels.

I think that you need to dive into MicroStation documentation for that.

Regards,
CVH

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Sat Sep 20, 2025 6:24 am

For the record:

I looked up the Linetypes for the lines in your second file.
Preferences: Metric, Global Linetype scale 1000

Simple Linetypes:
- 903-500 -> A, 0.0, -3.0 -> A dot every 1000 times 3 mm
- 954-500 -> A, 0.0, -0.75 -> A dot every 1000 times 0.75 mm

Complex Linetypes:
- All ending with CPLT00$_nN -> A, 5.0, -2.0, ["nN", arial.ttf, S=1.0, R=0.0, X=-0.5, Y=-0.5], -3.0
-> A dash 5.0 long, a space 2.0 long, 'nN' inserted at an offset (-0.5, -0.5), a space 3.0 long
-> Using arial.ttf in scale 1.0 rotated zero rads, all in mm but scaled up 1000 times

- A_02_931_S_KD|sciek2 -> A, 0.0, -0.6, [">", simplex.shx, S=0.6, R=0.0, X=-0.3, Y=-0.255], -0.03 (Corrected)
-> A dot, a space 0.6 long, '>' inserted at an offset (-0.3, -0.255), a space -0.03 long
-> Using simplex.shx in scale 0.6 rotated zero rads, all in mm but scaled up 1000 times
:arrow: This might be coded badly ... You definitely see a dot appearing inside the arrow when zoomed in.

Side notes:
- arial.ttf poses no problem on a Win system.
- simplex.shx is NOT backed by a QCAD CXF file (Also see post 46723) ...
... It is probably virtually substituted by another font.

I count 8 references to SHX shape files including one to qcadshp.shx (=qcadshp.cxf) (Probably the result of auto saving it in DXF format by QCAD)
Except that and ltypeshp.shx (=ltypeshp.cxf), the other 6 may not exist on your system.
Certainly not under the QCAD installation path.

Can you tell me what the original Linetypes were for the top 2 lines in the above opensite.jpg?

Regards,
CVH
Last edited by CVH on Thu Sep 25, 2025 4:18 am, edited 1 time in total.

Hoff
Newbie Member
Posts: 4
Joined: Fri Sep 12, 2025 2:09 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by Hoff » Wed Sep 24, 2025 12:25 pm

Hi,

Original line types for the top 2 lines in the opensite.jpg are 903-500 and 954-500. They are stored in .rsc file. After saving dwg file with those lines they were stored directly into the file.

Kind Regards,
Hoff
Attachments
geo-mz.zip
(24.28 KiB) Downloaded 190 times

CVH
Premier Member
Posts: 4955
Joined: Wed Sep 27, 2017 4:17 pm

Re: Line styles, multiline styles from MicroStation (OpenSite)

Post by CVH » Thu Sep 25, 2025 4:16 am

Hi,

The RSC file is in a binary format, it starts with the ASCII text 'Line Style Library'.
Part of the line style names are also retrievable in ASCII but that's about it.
Couldn't find any information on the format or on how to decode it.

Correct, Linestyle patterns used in a DXF are stored within the DXF to make it portable.
Chances are that the receiver doesn't has the same custom LIN files on his system.
It doesn't diversify between most common, standard and/or user defined patterns.

The draw-back is that a naming conflict may occur.
Suspecting that the stored pattern is used in that case.

To summarize:
- AutoCAD can read from a given RSC file but not everything is supported.
- MicroStation can create/export LIN style format backed by SHX shape files but not everything is 1:1, several footnotes apply.
- MicroStation may fall back on storing simple geometry only.
- As far as I know, QCAD does not supports the SHX shape file format and falls back on a replacement CXF file, if any.

From looking up 903-500 and 954-500 it must be obvious that these were stored as simple geometry only.
...CPLT00$_nN is an example where 'nN' is based on a standard TTF font.
A_02_931_S_KD|sciek2 is then an example where '>' is based on a SHX file. (Typo corrected in the above :oops: )
Filled shapes/fonts is not supported.


Note that 903-500 and perhaps 954-500 can be re-created using the LIN+SHX(=CXF) format.
The shapes used in combination with a dot in 903-500 look a lot like the small Greek letter Omega.
For 954-500 a shape in a CXF may be a solution but I am missing a curved line in this format.

Multi-line styles from the topic title are definitely out of the question. :(

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”