@csharp
-
@((MarkupString)Output)
+
@((MarkupString)Regex.Replace(
+ HttpUtility.HtmlEncode(@Output), "\r?\n|\r", "
"))
@code {
@@ -32,35 +35,35 @@ var p = wf.GetProfileByType(WideFlangeProfileType.W10x100);
for(var i=0; i<1; i++)
{
- var start = new Vector3(i, 0, 0);
- var end = new Vector3(i, length, i);
+var start = new Vector3(i, 0, 0);
+var end = new Vector3(i, length, i);
- // The bottom chord
- var bottomChord = new Line(start, end);
- var bottomChordBeam = new Beam(bottomChord, p, m);
- model.AddElement(bottomChordBeam);
+// The bottom chord
+var bottomChord = new Line(start, end);
+var bottomChordBeam = new Beam(bottomChord, p, null, m);
+model.AddElement(bottomChordBeam);
- var topChord = new Line(start + new Vector3(0,0,5), end + new Vector3(0,0,5));
- var topChordBeam = new Beam(topChord, p, m);
- model.AddElement(topChordBeam);
+var topChord = new Line(start + new Vector3(0,0,5), end + new Vector3(0,0,5));
+var topChordBeam = new Beam(topChord, p, null, m);
+model.AddElement(topChordBeam);
- Vector3 last = default(Vector3);
- for(var j=0.0; j<=1.0; j+=0.1)
- {
- var pt = bottomChord.PointAt(j);
- var top = pt + new Vector3(0,0,5);
- var panelLine = new Line(pt, top);
- var panelBeam = new Beam(panelLine, p, m);
- model.AddElement(panelBeam);
+Vector3 last = default(Vector3);
+for(var j=0.0; j<=1.0; j+=0.1)
+{
+var pt = bottomChord.PointAt(j);
+var top = pt + new Vector3(0,0,5);
+var panelLine = new Line(pt, top);
+var panelBeam = new Beam(panelLine, p, null, m);
+model.AddElement(panelBeam);
- if(j > 0.0)
- {
- var braceLine = new Line(top, last);
- var braceBeam = new Beam(braceLine, p, m);
- model.AddElement(braceBeam);
- }
- last = pt;
- }
+if(j > 0.0)
+{
+var braceLine = new Line(top, last);
+var braceBeam = new Beam(braceLine, p, null, m);
+model.AddElement(braceBeam);
+}
+last = pt;
+}
}
return model;";
private static string Output = "";
@@ -115,6 +118,11 @@ return model;";
var writer = new StringWriter();
Console.SetOut(writer);
+ // Redirect debug to the console.
+ Trace.Listeners.Clear();
+ Trace.Listeners.Add(
+ new TextWriterTraceListener(Console.Out));
+
Exception exception = null;
try
{
@@ -143,7 +151,6 @@ return model;";
Output = writer.ToString();
if (exception != null)
{
-
Output += "\r\n" + exception.ToString();
}
Console.SetOut(currentOut);
diff --git a/Elements.Playground/README.md b/Elements.Playground/README.md
index 2c84deef2..0552be000 100644
--- a/Elements.Playground/README.md
+++ b/Elements.Playground/README.md
@@ -9,7 +9,7 @@ This is a minimal example using .NET 5, Blazor webassembly, and Elements.
Visit http://localhost:5000.
### Publishing
-`dotnet public -c release`
+`dotnet publish -c release`
### Notes about hosting on Github Pages
- In the site's repo on github
diff --git a/Elements.Playground/wwwroot/js/model.js b/Elements.Playground/wwwroot/js/model.js
index b99318baa..2013da11d 100644
--- a/Elements.Playground/wwwroot/js/model.js
+++ b/Elements.Playground/wwwroot/js/model.js
@@ -58,18 +58,9 @@ function initializeEditor() {
enableLiveAutocompletion: true
});
- let timer;
- let runTimer = () => {
- timer = setTimeout(() => {
- invokeRun();
- }, 2000);
- }
-
editor.getSession().on('change', function () {
var code = editor.getValue();
DotNet.invokeMethod('Elements.Playground', 'SetCodeValue', code)
- clearTimeout(timer);
- runTimer();
});
}
diff --git a/Elements.Serialization.DXF/tests/DxfTests.cs b/Elements.Serialization.DXF/tests/DxfTests.cs
index 5f9eb5f89..60c8f9507 100644
--- a/Elements.Serialization.DXF/tests/DxfTests.cs
+++ b/Elements.Serialization.DXF/tests/DxfTests.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Text.Json;
using Elements.Geometry;
using Xunit;
@@ -67,7 +68,7 @@ public void DxfFromModel()
var renderer = new DXF.ModelToDxf();
var configJson = File.ReadAllText("../../../TestModels/cad-standard.json");
- var config = Newtonsoft.Json.JsonConvert.DeserializeObject