CamBam

Resources => Scripts and Plugins => Topic started by: EddyCurrent on May 30, 2015, 13:49:06 pm



Title: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 13:49:06 pm
This is more like it, forget the old Dotted lines stuff, let's start again.

There is one important thing to remember here, like the VEngrave plugin, if you save a file with Dashed Lines in it, you can not load it into CamBam if the Dashed Lines plugin is not installed. That is just common sense, nothing to do with me or the plugin.

Features:

1. select one or more polylines,
go to,
Main menu -> Edit -> Convert To -> Dashed Lines
Right click context menu -> Edit -> Convert To -> Dashed Lines
Choose the gap size and line type.

2. If you don't like the look of the converted line, repeat the process and choose new settings

3. Dashed Lines can be edited like polylines but you have to select the line and right click to get the menu, double clicking the line will not work.

4. Files containing Dashed Lines can be Saved and Loaded as you would with any other file, the only constraint being that the files cannot be loaded into a CamBam that does not have the Dashed Lines plugin installed.

Version 1 attached plus a test file.

Several improvements are in development.

Bubba, I need you to test this  :D

Remember to remove the old Dotted Lines plugin first (and throw it in the bin)

Edit:
Update added v2
1. Translation code added
2. Information in the Entity Tag: is no longer required for the plugin to work
3. Editable parameters, see picture.
  
   Click in the box and change these values, the Dashed Polyline will update to the new settings.

   If you enter a number < 1 for DotLineStyle, it will default to 1
   If you enter a number > 3 for DotLineStyle, it will default to 3
   If you enter a minus number or zero for Spacing, it will default to 1

Edit:
updated to v3
1. Converts directly to DotPolylines;  polylines, polyrectangles, circles, arcs, without having to convert to Polylines first.
2. Improved the look of Line Style 2 (dot/dash). Note: the enhancement will also be applied to any older files previously saved. This is becasue the cb file does not include details of how the line will be drawn.

Edit:
updated to v4
1. new line styles added
2. new menu form added
3. It's also possible to select more than one line and change the 'Spacing' and/or 'DotLineStyle' of all of them by editing the parameter value.
4. Translation code included

Edit:
updated to v5
1. It is now possible to use the mouse double click method to edit a DotPolyline.
Just double click on the line to enter edit mode.

Edit:
 updates to v6

1. Form translation code included

Edit: currently does not work with latest release version P ( 22 Sept 2015 )

Edit:
 updates to v7

For CamBam v1.0 ONLY

Edit:
 updates to v7.1

1. For CamBam v1.0 ONLY
2. TypeName field now hidden


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 14:43:21 pm
Hello,

Works for me  ;D

Note: the error messages are not translatable.

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 15:14:57 pm
Question,
Do we know how to validate input in the Properties area ? or how to refresh it if the values change.
I think there might be an event raised for text changed but I can't find it or get things that might be it to work.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 15:38:17 pm
I don't understand your question ..  :-[

If I change something in the property grid, the line are immediately updated, and if I change the line with the menu, the grid is updated too ...

I just try it on linux version.

- drawing dashed lines works
- save not works (XML error)
- a file created on win version can be loaded on linux version without errors and dashed lines are OK

I guess that maybe the pb has something to do with the problem related here ; not sure you can do something for that.

http://www.cambam.co.uk/forum/index.php?topic=4397.0

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 15:44:40 pm
I don't understand your question ..  :-[

If I change something in the property grid, the line are immediately updated, and if I change the line with the menu, the grid is updated too ...

++
David

If you enter in the property grid, DotLineStyle  = 10, the value shown will stay at 10 unless you come out of the grid then go back in.
Of course in the code I test for the value and don't let it go above 3.

What I want to do is; if anyone enters a number>3 in the box, the text should change to 3 immediately.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 15:54:02 pm
Linux should still be able to save the file, you would think.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 16:07:09 pm
I'll take a look tonight in the temp file created by linux ... now I must take my Grass Killer (and not Grace Kelly  ;D) before it rain again ..  ::)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 16:13:35 pm
Does the VEngrave plugin have the same issue with Linux ?


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 17:10:17 pm
Does the VEngrave plugin have the same issue with Linux ?

No, it works
++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 17:21:30 pm
I add the CB file that works and the tmp file given by linux when I try to re-save the same file on linux

(linux read it without problem but can't save)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 30, 2015, 17:34:25 pm
another example, because the first example has only dotted lines.

this new as 1 polyline and a dotted line ..

Hope that can help .. ;)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 30, 2015, 21:34:54 pm
Outputs seem to vary;

These extracts are from VEngrave

       <mop xsi:type="MOPVEngrave">
 
       <pline id="4" Closed="true">

This is from Dashed Lines

       <pline xsi:type="DotPolyline" id="2">

This is from your Linux example

       <pline id="1">


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 31, 2015, 11:35:56 am
updated to v3

1. Converts directly to DotPolylines;  polylines, polyrectangles, circles, arcs, without having to convert to Polylines first.
2. Improved the look of Line Style 2 (dot/dash). Note: the enhancement will also be applied to any older files previously saved. This is becasue the cb file does not include details of how the line will be drawn.

File added to first post


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on May 31, 2015, 13:58:45 pm
Hello,

Ah yes, linestyle 2 is prettier  ;)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 31, 2015, 14:32:07 pm
Pipes between processes can block until certain terminating conditions are met.  Perhaps it's not the process itself that's behind by 'one', but the pipe/channel communicating messages.

Flushing a pipe/channel would have the effect of forcing the message through.

Lloyd

Lloyd, wrong thread, you need to be here; http://www.cambam.co.uk/forum/index.php?topic=4665.msg37554#msg37554


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 31, 2015, 14:32:50 pm
Hello,

Ah yes, linestyle 2 is prettier  ;)

++
David

Currently adding more line styles  :D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: lloydsp on May 31, 2015, 14:34:29 pm
THAT's weird.  I posted to that thread, immediately after reading the comment about delayed responses from the child processes.

Hmm.... I'll re-post.
Lloyd


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 31, 2015, 14:39:03 pm
Lloyd, maybe you were behind by one and didn't flush the pipe ?  ;D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on May 31, 2015, 19:56:22 pm
New version added to first post v4.

1. new line styles
2. new menu

Just need Bubba to give it the thumbs up now  :D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on May 31, 2015, 20:47:27 pm
Just need Bubba to give it the thumbs up now  Cheesy
***********************************
When I find the time to test it you will see it.. I'm sure. ;) :D ;D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 01, 2015, 10:52:57 am
Updated file added to first post v5

1. It is now possible to use the mouse double click method to edit a DotPolyline.
Just double click on the line to enter edit mode.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 01, 2015, 12:36:53 pm
Hello,

Good addition  :D

The double click to edit dotpolyline is not working for me ...  ???

The form and its content is not translatable.

We can't use a value > 10 for spacing in the Form, but the properties grid accepts value > 10 (and the drawing reflect this value) ... it's a wish or a oblivion ?

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 01, 2015, 13:06:13 pm
Hello,
The double click to edit dotpolyline is not working for me ...  ???

I will remove all other plugins from my folder in case another one is helping it.

Quote
The form and its content is not translatable.

How do we translate Label text ? is translation required for this plugin ?

Quote
We can't use a value > 10 for spacing in the Form, but the properties grid accepts value > 10 (and the drawing reflect this value) ... it's a wish or a oblivion ?

Fixed, file updated on first post.


Edit: I just removed all other plugins and it still works okay.
Are you just double clicking on the line as you would to edit a regular polyline ?


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 01, 2015, 13:46:49 pm
Quote
I will remove all other plugins from my folder in case another one is helping it.

Ok, I'll do the same to test ... and I'll also take a try on my W7 insta that still use Pbeta2 (I use the very last P on XP pro) and I go back ..

Quote
How do we translate Label text ? is translation required for this plugin ?

to add the texts in the forms to the translation list you need:

- a 't' char in the Tag property of each label/button/container that must be translated , (and also in the Form tag property)
- a function with the same name as the form that contain the command to translate the form ( just after the InitializeComponent() )  (static void Translate(Form f))

Now, I have to leave, but I can watch it in the evening, if you want, send me the code and I take a look ; I think I can do it even If it's in C#  ;)

http://www.cambam.co.uk/forum/index.php?topic=3553.msg29394#msg29394

http://www.atelier-des-fougeres.fr/Cambam/Aide/API%20Doc/Cambam_cad_dll/Cambam_Utils/textTranslation.html

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 01, 2015, 14:18:22 pm
edit dotpoly with dbl click work on W7 + Pbeta2 ... I'll investigate further to know if it is related to Windows or to the CB version .. or other plugin installed ...

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 01, 2015, 17:07:02 pm
Translation code added to form.
I had a go with the translation plugin, this was the result  :D
new version v6 added to first post.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 01, 2015, 18:01:10 pm
Ok, that looks OK

I'll test tomorrow .... no mind to do that now  :'(

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 01, 2015, 18:10:10 pm
No problem, sorry to hear about your cat, I'll bet it was a good companion  :(


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 02, 2015, 16:25:44 pm
Hello,

Ok the pb is not related with the Win version nor the CB version, the double click to edit Dot Polylines stop working if I translate the name of the entity itself (the name that appears in the tree)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 02, 2015, 16:54:23 pm
Re

There is a problem with the translation ; the items to translate are added 3 time in the list.

1 - the english key to translate
2 - the same with the '!' in front
3 - the translated text is also added as a key.

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 02, 2015, 16:56:31 pm
Hello,

Ok the pb is not related with the Win version nor the CB version, the double click to edit Dot Polylines stop working if I translate the name of the entity itself (the name that appears in the tree)

++
David

It looks for the name "DotPolyline", don't translate it.

Code:
foreach (Entity ent in DashedLines.Myplugin.view.SelectedEntities)
            {
                // only enter edit mode if, Mouse Double click AND only 1 entity is selected AND primitive is DotPolyline AND no other edit mode running
                 if ((DashedLines.Myplugin.view.SelectedEntities.Length == 1) && (ent.PrimitiveType == "DotPolyline") && DashedLines.Myplugin.view.CurrentEditMode == null)
                {
                    EditPolylineEditMode em = new EditPolylineEditMode(DashedLines.Myplugin.view);
                    em.DefaultValue = null;
                    em.Prompt = TextTranslation.Translate("Drag Dotpolyline points, press enter or middle mouse to end, ESC to cancel");
                    DashedLines.Myplugin.view.SetEditMode(em);
                    DashedLines.Myplugin.view.RepaintEditMode();
                }
            }


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 02, 2015, 16:59:24 pm
Re

There is a problem with the translation ; the items to translate are added 3 time in the list.

1 - the english key to translate
2 - the same with the '!' in front
3 - the translated text is also added as a key.

++
David




StyleButtons is the name of the Group Box for the radio buttons
R1 to R5 are the radio buttons
label1 is the "Size"

Maybe it's doing it once for the Form ('this'), once for the group box, once for the radio buttons (3 times ) ?

I did it like that because it would not work at first , but then I found there were no entries for the French so I put some in. Maybe I should remove some of those entries and try again.


Code:
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            TextTranslation.Translate(this);
          
            this.StyleButtons.Text = TextTranslation.Translate(this.StyleButtons.Text);
            TextTranslation.Translate(this.StyleButtons.Controls, CamBamConfig.Defaults.Language);
            this.R1.Text = TextTranslation.Translate(this.R1.Text);
            this.R2.Text = TextTranslation.Translate(this.R2.Text);
            this.R3.Text = TextTranslation.Translate(this.R3.Text);
            this.R4.Text = TextTranslation.Translate(this.R4.Text);
            this.R5.Text = TextTranslation.Translate(this.R5.Text);
            
            this.label1.Text = TextTranslation.Translate(this.label1.Text);

        }


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 02, 2015, 17:11:23 pm
Ok, try with only

            TextTranslation.Translate(this);

to translate the form and remove all other translation code below.(but keeps the 't' tag in the objects to translate)

download the translate_fr file here that don't contains translations for your plugin
http://www.cambam.info/ref/ref.lang

set the flag '!' in the translate plugin, quit and run CB then run your plugin ; if the texts have a ! in front, they are translatable and no more code is needed (or if they are already in French = this key already exists and is already translated)

If some texts have not the ! and are still in English, then translation code is nedeed for this entry.only

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 02, 2015, 17:38:35 pm
Yes, that worked.

With just this line;   TextTranslation.Translate(this);

I have updated the file in the first post.

I will let you choose the best words for Translation  :D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on June 02, 2015, 19:23:55 pm
Hello,

Ok, that works   8)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on June 10, 2015, 14:06:51 pm
New version added to first post v4.

1. new line styles
2. new menu

Just need Bubba to give it the thumbs up now  :D

Nice work as usual, it works as advertised. Thanks Eddy! ;) :D ;D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on June 10, 2015, 20:23:02 pm
New version added to first post v4.

1. new line styles
2. new menu

Just need Bubba to give it the thumbs up now  :D

Nice work as usual, it works as advertised. Thanks Eddy! ;) :D ;D

Bubba, Thanks for trying it out and reporting back, I think the first version (dotted lines) put you off a bit, but once I had got the  save/save-as sorted out things got back on track, which is why I relaunched it.
For me, it works just like any built in CAD entity.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on June 10, 2015, 20:27:24 pm
For me, it works just like any built in CAD entity.
****************
I like it! Thanks again. ;D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on September 22, 2015, 13:36:50 pm
Hello,

Eddy, you can do a test with new P version ?

I can create a dotted line and save it, but when I try to load the file, CB say "unknown entity type" ...

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on September 22, 2015, 13:48:19 pm
David,
I get the same error, I'll recompile the code and see if that works.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on September 22, 2015, 14:02:18 pm
Yes, maybe

I need to re compile the "select unused shapes" for P (with the previous version, it don't recognize the lathe MOP)

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on September 22, 2015, 14:02:47 pm
David,

I used the latest CamBam.exe, CamBam.CAD.dll and CamBam.Geom.dll to recompile the code, but unfortunately same error  :'(
Half the problem is I don't fully understand the lines of code referring to xml


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on September 22, 2015, 14:18:54 pm
Quote
Half the problem is I don't fully understand the lines of code referring to xml

I never explored xml functionalities ... I can't help you for that, sorry ..  :-[

Decidedly, this is a plugin that gives you headache !!

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on November 06, 2015, 21:06:23 pm
Hate bring up an old tread..

Once drawing with dash lines is created and saved. Upon opening the file again everything is like it supposed to be except for the dash lines not shown at all, no lines shown at all. As I understand this is a old problem that I'm hoping it was fixed. Did I missed the fix somehow?.. Thanks. :D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on November 06, 2015, 21:10:26 pm
Hello

Yep, It no longer works with the P version of CB ... the dotted lines can be drawn but can't be re-read

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on November 06, 2015, 21:55:23 pm
And I can't fix it  ???


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on November 07, 2015, 00:21:09 am
And I can't fix it  ???

Ah, it feels good to know that's one of local guru's is on the job!! ;) :D ;D

Thanks Eddy.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: onekk on October 26, 2016, 08:42:30 am
Today I've checked some forum and found this thread,

After having played a little, maybe thi caould help.

This is the test file I've generated by the v6 version of this plugin compiled with the latest Mono on Linux.

The only thing I've done is cleaning the csproj file deleting all the things that are not strictly needed to compile it on Linux.

Hope it will help.



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 10:12:15 am
Carlo,

This plugin used to work with CamBam version P before the latest update, version P ( 22 Sept 2015 )
Since then it does what it should with the exception of loading a cb file with dashed lines in it.
'Unknown Entity' error.

To say this is annoying would be an understatement, if only Andy could say what changes he made to the new version and what I need to change to make this work again.

I don't know if it still works with the Linux version.

When I opened your file today, dashed.cb, I got the 'Error in XML document' error.




Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 26, 2016, 11:52:39 am
HI Eddy
I removed to refs to DotPolyline and the file loaded so it's not parsing the entity (line 7)  IIRC you had some code to load the entities. other than that "I got nothin".
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 12:03:41 pm
Dave,

From Linux the cb file uses this;

Code:
<pline xsi:type="DotPolyline" id="1">
          <ModificationCount>1</ModificationCount>
          <mat m="Identity" />
          <pts>
            <p>28,67,0</p>
            <p>118,69,0</p>
            <p>122,54,0</p>
            <p>68,12,0</p>
          </pts>
          <Spacing>1</Spacing>
          <DotLineStyle>1</DotLineStyle>
        </pline>


But from Windows it's this;

Code:
<DotPolyline id="1">
          <ModificationCount>1</ModificationCount>
          <mat m="Identity" />
          <pts>
            <p>28,67,0</p>
            <p>118,69,0</p>
            <p>122,54,0</p>
            <p>68,12,0</p>
          </pts>
          <Spacing>1</Spacing>
          <DotLineStyle>1</DotLineStyle>
        </DotPolyline>



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 26, 2016, 12:17:44 pm
HI Eddy
Is this of any use http://www.w3.org/TR/xmlschema-1/#no-xsi (http://www.w3.org/TR/xmlschema-1/#no-xsi)
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: onekk on October 26, 2016, 13:33:26 pm
Ok Eddy asap I try to edit the file by hand and remove the xsi instance in front of the XDotPolyline.

I suspect that something is changed in the way the code process the fcreation of new entities of type different from those defined by Andy, but I don't have access to the sources.

I let you know if something useful appear, even an error code in CamBam .

Sorry for the inconvenience.

 


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 13:34:53 pm
Dave,

I'ts Andy who has made those XML files the way they are, my problem is when the file is opened again in CamBam, some internal checks beyond our control are flagging up an 'Unknown Entity' error, but in the previous CamBam version they did not do that and this plugin worked fine.

David said this in another thread about another issue;
"Ah ! ok  ... it's a known bug ... there is a compatibility problem between xml files created with linux and Win version."


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 26, 2016, 13:43:29 pm
Ok Eddy 
How did you define the DotPolyine as an entity and save it in the file in the first place.
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 13:45:27 pm
Dave, the source files are in my first post of this thread, probably better to look there, or to put it another way, I can't remember myself without looking at it all again  :D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 26, 2016, 13:56:00 pm
No Worries Eddy
thought of that after I posted ::)
I'll have a look at in the morning.
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 13:58:22 pm
Dave,

This is some of it, the top line along with other xml code makes it save the cb file correctly.

Code:
 [XmlType("DotPolyline"), Serializable]  
        public class DotPolyline : Polyline
        {
            // default constructor with default value of Spacing
            public DotPolyline() : base()  
            {
                Spacing = 1;
                DotLineStyle = 1;
            }
      
            public double Spacing { get; set; }
            public int DotLineStyle { get; set; }
            private double StepSize;
            private int dotlinestyle;
  
            public override void Paint(Display3D d3d)
            {

As I say, it used to work until the latest CamBam version so logically Andy changed something.

It's only a guess but he might have been experimenting with some new entity types for the next version and as a consequence but some extra error checking into his code.

Edit: I've just tried loading the dashed.cb file from Carlo with the previous version of CamBam;

CamBam plus [0.9] Rel 8P (beta-2)
Copyright © 2013 HexRay Ltd

and it worked, but it can't open the dashed line files saved by the latest version because the XML format is different.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on October 26, 2016, 16:23:42 pm
As I say, it used to work until the latest CamBam version so logically Andy changed something.
*********************
Yep!

 It still works , but it won't save.. ::) ::) ::)

Andy opposes dashed lines in CB.. ;D ;D ;D ;D


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 26, 2016, 16:35:03 pm
I must have crossed the line  ;)


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 26, 2016, 22:38:42 pm
HI Eddy
Code:
[/ CADFile.ExtraTypes.Add(typeof(DotPolyline));
new XmlSerializer(typeof(DotPolyline)).Serialize(new MemoryStream(), new DotPolyline());code]

This what I was looking for, Maybe the new CB uses a later version of the .net framework or the CADFile.ExtraTypes has changed. "clutching at straws here".
BTW the new version of Ilspy Isn't working for me, had to revert to the older version!.
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: onekk on October 27, 2016, 06:43:30 am
If this can help you I have this version with the latest mono installed on Linux.

Hope the picture is clear


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 27, 2016, 07:42:54 am
Dave,

Thanks for taking the time to look at this now Carlo has resurrected it  ???

but those lines were already in.

Code:
          // Required so that the files will 'save' without xml errors.
           if (CADFile.ExtraTypes == null)
           {
            CADFile.ExtraTypes = new List<Type>();
            }
            CADFile.ExtraTypes.Add(typeof(DotPolyline));

                     
            // HACK: Per 10bulls, this fixes clipboard errors associated with
            // copying external assembly objects that have not been serialized.

           //     DotPolyline mx = new DotPolyline();
           //     XmlSerializer serializer = new XmlSerializer(typeof(DotPolyline));
           //     MemoryStream ms = new MemoryStream();
           //     serializer.Serialize(ms, mx);
           
            new XmlSerializer(typeof(DotPolyline)).Serialize(new MemoryStream(), new DotPolyline());

  // both of the 10 bulls hacks above work but neither solve the file reloading problem



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: onekk on October 27, 2016, 09:53:01 am
In the Mono implementation Xml Serialization is slightly different as some things where not implemented yet, maybe the different behaviour is related to this.

I suspect that the Linux version is slightly different as Andy seems to use the Mono costruct available at the time of the Linux Version creation.

Hope in future version the different behaviout of Linux and Windows version regarding the File "Interoperability" will be not present.

For now I'm not expert enough to help you, but if you want some beta test on Linux You are welcome.

Regards


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dave benson on October 27, 2016, 13:48:14 pm
H Eddy
Got Ilspy going (win7 32) for me Carlo
I'm pretty sure Paul had some trouble with his Vengrave plugin and it was to do with serialisation of his mop.
so I just tested the plugin and it works.
I'll have a dig around through the threads tomorrow  to see what it was and how he fixed it. might help might not
Dave


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on October 27, 2016, 14:22:55 pm
Dave,

Yes, I went through VEngrave code at the time, but that made a new MOP whereas I'm making a new Entity.
I think until the new version of CamBam, is released it's not worth any effort trying to make this work just yet.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: RJS on January 04, 2017, 19:54:39 pm
First this is a great plug in! 

Sorry if I am missing the obvious but how to you use this to create a dashed engraving tool path.  In other words I am trying to create a toolpath that is dashed like the line appears after using the plug in.  When I draw a line, convert it to a dotpolyline, apply a engrave MOP and then produce the gcode the line is still a normal polyline with no dashes.

Here is the gcode file contents:

( Made using CamBam - http://www.cambam.co.uk )
( Untitled 1/4/2017 12:51:13 PM )
( T1 : 0.3 )
G21 G90 G91.1 G61 G40
G0 Z0.1
( T1 : 0.3 )
T1 M6
( Test DotPolyline )
G17
M3 S650
G0 X0.0 Y60.0
G1 F300.0 Z-0.1
G1 F400.0 Y-71.0
G1 Y60.0
G0 Z0.1
M5
M30


Thanks!

RJS


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on March 30, 2017, 17:34:07 pm
RJS

As you found it won't work like that, it just looks to be dashed.   ;)


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on March 30, 2017, 17:41:25 pm
It looks like we are back in business  ;D ;D

Version 7 attached to first post in this thread, it's for CamBam v1.0 only
Also attached here is a test file that dh42 originally posted

The answer came from Karst Drenth's Solids plugin, so thanks Karst  ;)
this was the missing code from the DotPolyline class;


Code:
[XmlAttribute(AttributeName = "type", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
        public virtual string TypeName
        {
            get
            {
                return base.GetType().Name;
            }
            set
            {
            }
        }

        [Browsable(false), XmlIgnore]
        public virtual string DisplayName
        {
            get
            {
                return base.GetType().Name;
            }
        }


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on March 30, 2017, 18:22:26 pm
Eddy,

Thanks for repairing this, it works great! Just created simple file,save it. To be sure it works closed CB completely, after opening saved file all dotted lines appeared like it should. Job well done, Thanks again!


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: lloydsp on March 30, 2017, 18:39:39 pm
Yes, Eddie:  Thanks!

ALSO, thank you for spending the time with Karst's code to understand some of the innovations he's brought to the collective mind, here.

Every time I see a new 'unexpected' plugin come on here, I see innovation.  Someone has discovered something new about the CB toolset that makes our future lives (and possibly even Andy's) easier and more productive.

I wish I had time to devote to CB code, again.  I shall (sometime), but business is just crushing me right now.  I guess I could have worse problems, huh?

LLoyd


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: dh42 on March 30, 2017, 19:35:48 pm
Hello,

Congratulation Eddy  :D ... plugin tamed !

++
David


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on March 30, 2017, 19:55:23 pm
Thank you gentlemen, appreciated, but as Lloyd said it's the contributions from everyone that bring it all together.

I just wanted to remind everyone that after a dashed line is drawn, it's style and spacing can be changed by clicking in the appropriate box and changing the numbers.

And I've just noticed there is a field called 'TypeName', it would be best if this was not shown so I'll have to look at that, in the meantine be sure not to edit that field.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Bubba on March 30, 2017, 20:08:28 pm
And I've just noticed there is a field called 'TypeName', it would be best if this was not shown so I'll have to look at that, in the meantine be sure not to edit that field.
************************
Eddy, I must honestly say I didn't even noticed this. Used the settings box that is active when plugin is evoked.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: karst.drenth on March 30, 2017, 20:51:30 pm
cool stuff Eddy  !

glad that my stuff helped out  ;D

tip:

put the [Browsable(false)] attribute on TypeName ;)

I am currenty rounding up the code for the solids, so there is more interesting code to come...

Grtzz,

Karst


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on March 30, 2017, 21:09:12 pm
Thanks Karst, that did the trick, the TypeName field is now hidden.

It's fair to say I would never have worked that xml stuff out myself.  ???

Version 7.1 attached to first post in this thread


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: karst.drenth on March 30, 2017, 22:39:43 pm
You're welcome !  ;D

...I am currenty rounding up the code for the solids, so there is more interesting code to come...

Here: http://www.cambam.co.uk/forum/index.php?topic=6482.msg51798#msg51798 you'll find the latest sources I was referring to.


Oh... btw you might want to put an [Category("Dottet Line")] attribute to your new properties, to let them show up nicely in the PopertyEditor :)

Grtzz,

Karst


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: sibianul on August 09, 2017, 09:18:37 am
Hello guys,

awesome plugin !

I used it now on a new project I want to start, to keep my kids busy :)

is there a way to convert the dashed line to points ? I want to drill each dot in the dashed line, is there a way to do it ?



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on August 09, 2017, 10:10:45 am
is there a way to convert the dashed line to points ? I want to drill each dot in the dashed line, is there a way to do it ?

As the saying goes, "Where there's a will there's a way"  :D
I'll have a look. It will be easier to use normal polylines and convert those to points, so new plugin I think.


I saw someone making lampshades with a drilled pattern like that.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: sibianul on August 09, 2017, 10:13:36 am
Thanks Eddy, I have tried to explode thinking it will work, but it's still a normal line after explode. I have also tried with Corel Draw, to convert the lines to dots, but I didn't had any luck there either, on the dxf export I got normal lines in cambam


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on August 09, 2017, 10:15:55 am
You could draw a polyline then use, Draw->Pointlist->Step Around Geometry
then delete the original polyline.

So no new plugin required

Just tried that method and it should work good for you.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: sibianul on August 09, 2017, 10:27:53 am
Just amazing how powerful this software is :D

Thank you very much!!!


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on August 09, 2017, 10:33:40 am
Example  :D



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: sibianul on August 09, 2017, 11:33:36 am
Second step (drilling) done :) Now to find some small nails, than the kids will get some colorful strings from their grandpa, and start the hard work :)

This method DRAW - POINTLIST - STEP AROUND GEOMETRY solved my issue in seconds, very very easy.. I think I lost more time in Corel trying to export the dotted line than it took to actually drill the holes on the CNC :)



Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Garyhlucas on August 09, 2017, 23:00:04 pm
Nice project for the kids. My grandson bought a piece like that. I never thought to bang one out on the cnc!
My little homebuilt is pretty quick. I'd bet on about 100 holes per minute in wood.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: EddyCurrent on August 10, 2017, 08:33:52 am
We used to make these years ago, great little books with many patterns in them.


Title: Re: Dotted Lines reborn as "Dashed Lines"
Post by: Garyhlucas on August 10, 2017, 19:09:43 pm
Back when my grandson was five I decided to make him a set of wooden blocks from 3/4" x 1-1/2" poplar in lengths of 1-1/2", 3", 4-1/2", 6", and 12" with the 3" being the largest quantity. My reasoning was that basic blocks encourage creativity but the biggest problem is that you never have enough to build that house or castle or race track. So this set in a fitted wood box is over 800 pieces!

So we built towers all the way to the ceiling and knocked them down with the RC cars. He uses them like dominoes running all around the house and then lets them fall in a cascade. He builds ramps for his model cars. At 14 he still pulls them out and plays with them.

Cutting them up took a couple hrs. I could not find a fast way to round the corners. I wound up doing 20 at a sitting with fine sandpaper for MONTHS until they were all done!