Author Topic: Problems with dashed lines  (Read 602 times)

May 03, 2019, 10:41:02 AM
Read 602 times

jdb2

  • Jr. Member

  • Offline
  • ***

  • 13
  • Gender
    Male

    Male
Hello :) I'm new to Inkscape and this is my first post in this forum :) My question concerns a problem I've been having with inserting vertical, straight dashed lines into a diagram I've been editing. After I select the pen tool, create a stroke and then convert it to a path, I can open up the "Fill and Stroke" menu, but, when I navigate to "Stroke style", it's greyed out. The width of the path is set to 0 pts and every time I try to change it it gets changed back to 0 again, which is probably why I can't modify the stroke style.

Any help would be appreciated.

Thanks,

jdb2
  • 0.92.4
  • Linux Mint 19 Cinnamon 64-bit

May 04, 2019, 05:17:22 AM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Don't convert the path to a path.

What you've been doing is:

- draw an open path with a stroke on it
- convert the outline of that stroked line into a filled area without a stroke
- try to add dashes to a shape that has no stroke

What you want to do is:

- draw a line with a stroke
- make the stroke dashed

May 04, 2019, 06:58:08 AM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Hhmm....I'm concerned why the stroke should be zero width.  Moini's correct about not using Stroke to Path. 

But even using Stroke to Path, unless the last time you made a stroke, you made it zero width, that stroke should have a width.  But even if that's what happened, you should be able to give it a width.

The fact it won't accept a new width makes me wonder if it's part of a group.  Have you been working with groups at all?  It's possible you could have entered a group and with or without realizing it, you're adding the new stroked path to a group.  That could be causing it not to accept a new width.

However, note that even though the dialog won't show a stroke width for a group, and even if you try to change the width and it goes back to zero, the object on the canvas does get a new width.  (This zero stroke width for groups is a relatively recent feature of Inkscape which annoys me to no end.  I understand why developers did it, but it seems to me there could be a better solution.)

If you can't sort out what's happening from these comments, please feel free to share the SVG file with us, and we can help you sort it out.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

May 04, 2019, 08:14:32 AM
Reply #3

jdb2

  • Jr. Member

  • Offline
  • ***

  • 13
  • Gender
    Male

    Male
Welcome to the forum!

Hhmm....I'm concerned why the stroke should be zero width.  Moini's correct about not using Stroke to Path. 

But even using Stroke to Path, unless the last time you made a stroke, you made it zero width, that stroke should have a width.  But even if that's what happened, you should be able to give it a width.

The fact it won't accept a new width makes me wonder if it's part of a group.  Have you been working with groups at all?  It's possible you could have entered a group and with or without realizing it, you're adding the new stroked path to a group.  That could be causing it not to accept a new width.

However, note that even though the dialog won't show a stroke width for a group, and even if you try to change the width and it goes back to zero, the object on the canvas does get a new width.  (This zero stroke width for groups is a relatively recent feature of Inkscape which annoys me to no end.  I understand why developers did it, but it seems to me there could be a better solution.)

If you can't sort out what's happening from these comments, please feel free to share the SVG file with us, and we can help you sort it out.

Thank you for the reply! :)

I can't seem to figure out how to get the dashed lines I want even after following the advice posted in this thread -- perhaps I'm missing something simple. The SVG file ( which was created by me ) is on the Wikimedia Commons and can be found here :

https://upload.wikimedia.org/wikipedia/commons/c/ca/HP_Saturn_register_fields_SVG_v.2.svg

I'm just trying to draw dashed vertical lines that help the viewer with discerning the nibble alignment of the register fields.

Thanks,

jdb2

EDIT : Note that the SVG file in question was originally created using Draw.io and then touched up using Inkscape. I'm wondering if Draw.io's SVG export function has introduced some type of problem in the XML SVG file which is causing Inkscape to behave strangely.
  • 0.92.4
  • Linux Mint 19 Cinnamon 64-bit

May 04, 2019, 10:57:10 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Yes, something is strange in this file.  I'm not sure if it comes from the other program, or is just the current state of the file.  The only layer indicates that it's part of a group (not "Layer 1" or "root layer" which would be expected).

Oh, this is very strange.  I've never seen this before.  When I first open the file, it shows #g1366 in the Layer indicator in the status bar.  That indicates you have entered a group.  But there are no other layers (or objects outside the group) which normally clicking on those would take you out of the group.

To try to gather further info, I had opened the XML Editor.  Once I selected the parent group, then the Layer indicator in the status bar shows root layer.  I closed the file and reopened it, to see if I could reproduce that, and I did.

I think this is your problem.  You're inside a group, and it won't let you set a stroke width.

After close and reopen again, I tried something that would be easier for you (than the XML Editor).  So do this.  Open Object menu > Objects.  In that dialog, click on g1366.  That will take you out of the group.  Then close the dialog (keeping it open can make Inkscape slow).

After that you should be able to draw on top of that group (which is everything in the drawing).  I think everything should be ok from there.

But if you need to select individual parts of the image, you'll need to select it and Ungroup.  Possibly a few ungroups will be needed.  Just watch the status bar as you click.  When the status bar says "No groups to ungroup" you'll know that everything is ungrouped.  Ungroup is this button  :ung:  or Object menu > Ungroup.

It may be that after you save your changes, the next time the file will open properly.  But if the problem comes from the other program, you may need to use the trick with Objects dialog every time you open it.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

May 06, 2019, 09:32:02 AM
Reply #5

jdb2

  • Jr. Member

  • Offline
  • ***

  • 13
  • Gender
    Male

    Male
Yes, something is strange in this file.  I'm not sure if it comes from the other program, or is just the current state of the file.  The only layer indicates that it's part of a group (not "Layer 1" or "root layer" which would be expected).

Oh, this is very strange.  I've never seen this before.  When I first open the file, it shows #g1366 in the Layer indicator in the status bar.  That indicates you have entered a group.  But there are no other layers (or objects outside the group) which normally clicking on those would take you out of the group.

To try to gather further info, I had opened the XML Editor.  Once I selected the parent group, then the Layer indicator in the status bar shows root layer.  I closed the file and reopened it, to see if I could reproduce that, and I did.

I think this is your problem.  You're inside a group, and it won't let you set a stroke width.

After close and reopen again, I tried something that would be easier for you (than the XML Editor).  So do this.  Open Object menu > Objects.  In that dialog, click on g1366.  That will take you out of the group.  Then close the dialog (keeping it open can make Inkscape slow).

After that you should be able to draw on top of that group (which is everything in the drawing).  I think everything should be ok from there.

But if you need to select individual parts of the image, you'll need to select it and Ungroup.  Possibly a few ungroups will be needed.  Just watch the status bar as you click.  When the status bar says "No groups to ungroup" you'll know that everything is ungrouped.  Ungroup is this button  :ung:  or Object menu > Ungroup.

It may be that after you save your changes, the next time the file will open properly.  But if the problem comes from the other program, you may need to use the trick with Objects dialog every time you open it.

Thanks so much for your help! :D It completely fixed the problem :)

Here is the new SVG image : https://commons.wikimedia.org/wiki/File:HP_Saturn_CPU_register_fields_v.3_SVG.svg

I think there should be a sticky about editing SVG files exported by Draw.io after they've been imported into Inkscape as many people have probably experienced the same problems.

Thanks and regards,

jdb2
  • 0.92.4
  • Linux Mint 19 Cinnamon 64-bit

May 07, 2019, 05:49:26 AM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Glad to hear the good news!

As I said, it's not clear how the file got to be the way it was.  You may have accidentally gotten into that predicament on your own.  It is possible to do.  But it's also possible it came from the other program.  I just don't have enough info to make that call.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

May 07, 2019, 07:44:27 AM
Reply #7

jdb2

  • Jr. Member

  • Offline
  • ***

  • 13
  • Gender
    Male

    Male
Glad to hear the good news!

Thanks :)

Quote (selected)
As I said, it's not clear how the file got to be the way it was.

Well, as I said, I first used Draw.io to create the image and then I used Draw.io's export to SVG function. When I tried to upload that particular SVG file to the Wikimedia Commons, the upload wizard complained about unsupported XML namespaces, which I had to manually remove with a text editor. I think Draw.io produces problematic SVG files.

Quote (selected)
  You may have accidentally gotten into that predicament on your own.  It is possible to do.  But it's also possible it came from the other program.  I just don't have enough info to make that call.

Well, I hadn't grouped the imported SVG in Inkscape, so I think it was Draw.io . I can give you the original Draw.io file, saved in its own proprietary format here :

*HP-Saturn-CPU-register-fields.zip
(2.1 kB - downloaded 69 times)


Regards,

jdb2
  • 0.92.4
  • Linux Mint 19 Cinnamon 64-bit

May 07, 2019, 12:29:17 PM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Well if you had not done any grouping, it's possible the draw.io program did it.  But if you had inadvertently double-clicked on the group (which enters the group), then saved the file that way, the file might have ended up that way I saw it.  (emphasis on "might")

I can't open that draw.io file.  But if you can attach the SVG file which it produces, without doing anything to it, that would at least give me a hint that the problem comes from draw.io.

Ok, never mind.  I searched it out, made a simple drawing in Draw.io, and exported an SVG file.  It does not show this problem.  It shows a proper group, not an entered group.  So I can't reproduce that problem.  Maybe when you edited the file in a text editor, it changed something?

You say you edited the namespace?  Geez, I can see why wikimedia rejected it.  That code is totally borked!  I'm surprised Inkscape can open it at all.  The entire code from svg to /svg, is on one line.  Tags are missing.  Maybe the problem does come from draw.io, but I would need to be able to reproduce it, before I take the step to post a warning about it.

I can't seem to reproduce this in Inkscape, that having entered a group and then saving the file, it opens as being already inside the group.  If we could figure out how that happened, we might report it as an Inkscape bug.  I've been trying to make it happen, but so far, I can't.  I did see another person with this problem (maybe a couple of years ago), so I think there could be some way to do it.  But so far, I can't figure it out.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann