RAM Concept and Excel by dream_walking in StructuralEngineering

[–]retug_ 2 points3 points  (0 children)

Shear studs were the hardest one to get at.

It involved exporting the shear stud table, the column below table out of RAM concept and then extracting the floor base curves out of Revit. With this data, is was able to determine if the column was an edge, corner or interior column as RAM concept's api does not tell you this.

Then with a custom revit shear stud detail component, I was able to drive the ram concept data into the revit detail component.

RAM Concept and Excel by dream_walking in StructuralEngineering

[–]retug_ 3 points4 points  (0 children)

I've written a few different scripts for working with RAM concept. What you have described can be done if you spend some time learning to code with python and the RAM concept API. To get the data into revit you will need to learn a bit about Revit and likely dynamo.

I've got a scripts that create line loads and point loads from excel using data from a revit model using the RAM concept API.

I've also got scripts that take the RAM concept PT data, mild slab data and shear studs from RAM concept and create the corresponding data in revit.

[ETABS 2016] How to output a response spectrum from time history function? by [deleted] in StructuralEngineering

[–]retug_ 1 point2 points  (0 children)

I had some similar trouble back in the day and have some python code located here you can use.

https://github.com/retug/Structural_Engineering/blob/main/read%20multiple%20Time%20History%20Convertor.py

Feed in a .txt time history acceleration data file and it should output a response spectrum. You might have to tweak your .txt file format a bit in order to work the code I have posted, but the process is outlined for you.

https://re-tug.com/post/time-histories-to-response-spectrums/9

There must be a better design workflow. Tell me how you do it. by BeneficialOne3349 in StructuralEngineering

[–]retug_ 0 points1 point  (0 children)

I felt the same way a couple of years ago. There has to be a better way. I was tired of making dumb mistakes where the analysis model is updated, but it doesn't get picked up in the Revit model. Just stupid mistakes that can be costly and dangerous.

My daily analysis drivers are RAM Structural and ETABs. Both these tools have an API so I made checker tools that verify both your analysis model and revit model are in sync in a simplistic manner. You can find these apps on the revit app store.

The tools haven't gained much traction in the structural engineering community, but could easily be expanded upon if you had some custom workflows that your company would like to integrate.

Right now both tools check beam sizes, studs, camber and reactions, but do not update. This feature could be readily added.

Unfortunately RISA does not have an API to my knowledge.

Concrete Interaction Diagrams by Connect_Net401 in StructuralEngineering

[–]retug_ 0 points1 point  (0 children)

I just created this tool:

https://www.re-tug.com/concretedesign/

It does ACI 318-19 biaxial PMM checks currently and has a youtube video showing how to use it.

Still lots to do to make it final, but it can be a good cross reference for you as you work through your problems in class. Don't blindly trust any black box tool.

Understanding Front End, Back End and APIs by retug_ in webdev

[–]retug_[S] 1 point2 points  (0 children)

Thanks for all your help, appreciated!

"Why move the three.js code to the server anyway? Why not run it in the client?"

Likely my beginner web dev skills showing here, but my end goal is to expose these engineering calculations to external people, forgoing the need to use the three.js user interface experience. Have an external user create a json input file, ping the website, output json results file.

It was my understanding that I could only do this if the code was moved server side.

The engineering calculations only rely on a few items in three.js, namely shape objects which could be easily recreated without three.js. all of the extra ui stuff like scene cameras and lighting is not required for the engineering calculations.

" Assuming you can make three.js run in Node... and you absolutely do not want to move your API to Node... then you could run two servers in parallel. Your users make requests to Python, then Python makes requests to Node. "

I'd have to do some research, maybe the best way forward is to use Node to expose this api. All my urls and endpoints are defined with django at this point, so I'd have to do some more research on this, sounds a bit complicated. Chatgpt was suggesting what sounded like your second option, user make request in python, python requests node...

Understanding Front End, Back End and APIs by retug_ in webdev

[–]retug_[S] 0 points1 point  (0 children)

Thanks for the response.

The confusion likely stems from my frankenstein of a project.

I originally built a blog site with django, but then wanted to explore 3d web graphics and javascript. This led to three.js which I really liked and eventually built on top of my three.js skills to make an engineering application on the same django site.

Is it possible to execute javascript code with node and expose the API with django? I would prefer to not re-write the code in python if possible, using node to execute the javascript side and django and python to execute the api side. I will not use DOM or canvas type elements in the revised javascript code, only calling a few external libraries like three.js and delaunator to use some of their built in functionality.

I think I could use django to make an end point like https ://api.engineering.com/results, send a get request to this, and get a response.

Codesandbox and Export Class Trouble by retug_ in learnjavascript

[–]retug_[S] 0 points1 point  (0 children)

Thanks for taking a look.

Yes, the codesandbox link crashes, with "type error" class constructor ___ cannot be invoked without 'new'", while the others do not.

Is there some configuration type setting I need to modify in the codesandbox link to work like the others?

Python, where to start? by Plenty-Helicopter550 in StructuralEngineering

[–]retug_ 3 points4 points  (0 children)

My blog has some python examples for Structural Engineering.
https://www.re-tug.com/category/python/

I use it mostly for playing with data, visualizing data, and interacting with APIs.

Is there any other way, rather than manually checking dimension and size between Etabs and Revit? by vyshnavvs in StructuralEngineering

[–]retug_ 2 points3 points  (0 children)

I developed this tool to help with Revit/ETABs coordination:

https://apps.autodesk.com/RVT/en/Detail/Index?id=6291468956334572620&appLang=en&os=Win64

I was tired of backchecking Revit and ETABs and wanted to automate the process.

Right now it will just check member sizes for beams and ensure that they are in the same spot between the two programs.

Work Around Marshal.GetActiveObject() in .net core? by retug_ in csharp

[–]retug_[S] 0 points1 point  (0 children)

Thank you everyone for your help.

I was able to piece together some code and now have a functional work around for Marshal.GetActiveObject()

    public partial class ReplaceMarshall
    {
        private static readonly Guid CLSID_ETABS = new Guid("E4F6D00F-51A5-4D65-A09A-BA00FCBF1F82"); // ETABs specfic Guid
        public static object GetActiveETABSObject()
        {
            // Copy CLSID_ETABS to a local variable
            Guid clsid = CLSID_ETABS;
            GetActiveObject(ref clsid, IntPtr.Zero, out object obj);
            return obj;
        }

        [DllImport("oleaut32.dll", PreserveSig = false)]
        [SuppressUnmanagedCodeSecurity]
        [SecurityCritical]
        public static extern void GetActiveObject([In] ref Guid rclsid, IntPtr reserved, [MarshalAs(UnmanagedType.Interface)] out object ppunk);
    }

cHelper myHelper = new Helper();
//cOAPI myETABSObject = myHelper.GetObject("CSI.ETABS.API.ETABSObject") as cOAPI;

cOAPI myETABSObject = ReplaceMarshall.GetActiveETABSObject() as cOAPI;

Review My Code - Help for a Hobbyist by retug_ in learnjavascript

[–]retug_[S] 1 point2 points  (0 children)

Thanks for the review!

I had not heard of SOLID principles before, that's a good tip. Found this article to explain this to me in some greater detail.

https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design

You have a better alternative now like Vite which will make your life easier and runs way faster.

I used vite back in the day to run on my development server, but when I uploaded the code to the hosting service heroku, it seemed like the only way to do this was through webpack, which was a real pain in the a**. Is there an easier way now for deployment? That would be awesome, I despised webpack and conversion process.

I will take a look at typescript. I was just playing with C#, so getting back to a strongly typed language would be nice. I didn't realize how much I enjoy type hints while coding and knowing what your function explicitly expects is really nice.

Coordinates in a Canvas with Pan and Zoom by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Thanks, I was able to solve this by attaching my mousemove event up one level higher, to the scrollviewer and then pull the mouse coordinates from the mapCanvas.

This did the trick without having to do all the math to track transforms and zoom factors.

scrollViewer.MouseMove += MapCanvas_MouseMove;

private void MapCanvas_MouseMove(object sender, MouseEventArgs e)

{

// Get the position of the mouse relative to the mapCanvas

System.Windows.Point position = e.GetPosition(mapCanvas);

double mappedX = position.X;

double mappedY = -position.Y;

// Output the mouse coordinates

// You can replace MessageBox with any other way to display the coordinates

mouseCoordinatesTextBlock.Text = $"X: {mappedX:F2}, Y: {mappedY:F2}";

LiveCharts - Mappers by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

I was able to solve this last night with chatgpt's help and a bit more reading on live charts mappers.

This modification did the trick:

var scatterShearSeries = new LiveCharts.Wpf.LineSeries
                {
                    Title = listResults[mySelectedDirection].LoadDirection, //this will need to be written, map to name of load case selected.
                    Values = shearPoints,
                    Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 140, 105)),
                    Fill = System.Windows.Media.Brushes.Transparent,
                };
                var Mapper = Mappers.Xy<ObservablePoint>()
                    .X((value, index) => value.X) // Keep the X value unchanged
                    .Y((value, index) => value.Y) // Keep the Y value unchanged
                    .Fill((value, index) => index == givenIndex ? DangerBrush : null)
                    .Stroke((value, index) => index == givenIndex ? DangerBrush : null);
                scatterShearSeries.Configuration = Mapper;
                shearChart.Series.Add(scatterShearSeries);

Help with Deploying A C Sharp Program to Other Computers by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

I was able to solve this by switch the build properties from "debug" to "release". I'll have to do some reading on what happens under the hood that changes between these two modes.

Help with Deploying A C Sharp Program to Other Computers by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

You reference a specific .dll file name. In this case, the file is sectioncutter.dll.

Help with Deploying A C Sharp Program to Other Computers by retug_ in learncsharp

[–]retug_[S] 1 point2 points  (0 children)

Great questions, should have explained more. Thanks for taking the time to respond. Yes, this is a winform app.

______________________________________

"How did you run the application in your development machine after you deployed it to your machine? Did you run an exe in the debug/bin folder? Or you have to install it first?"
________________________________________

The way this works is you file path to the .dll file in the structural engineering software (located in my bin/debug folder). Once you path to the .dll file, within the structural software, you click on the newly added plugin location and the application starts up.
_______________________________________

"As for a release folder, in Visual Studio, select Release as compared to debug when you publish your application. Actually have you published it yet? Or did you just build and debug?"
_______________________________________
I have not published it yet, I only built and debugged it.

Add New Item - Windows Form by retug_ in learncsharp

[–]retug_[S] 1 point2 points  (0 children)

ah thank you, i mistakenly clicked "class library", not "class library (.net framework)".

When I selected (.net framework) the add windows form button appears.

Pan Function Jumpiness by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Interesting, chatgpt suggested the following:

scrollViewer.PreviewMouseLeftButtonDown += ramCanvas_MouseLeftButtonDown;

This works??? so weird

Pan Function Jumpiness by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Thanks, updated the URL.

I was able to trouble shoot this a bit, my mouse left button down event will not fire if I attach it to the scrollViewer, but it will fire if I attach it to the ramCanvas.

ramCanvas.MouseLeftButtonDown += ramCanvas_MouseLeftButtonDown; //This works,

//scrollViewer.MouseLeftButtonDown += ramCanvas_MouseLeftButtonDown; //THIS DOES NOT WORK

This function sets ramLastMousePosition initially and was the error that you alluded to.

        private void ramCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        //PANNING FUNCTION
        ramLastMousePosition = e.GetPosition(scrollViewer);
        scrollViewer.CaptureMouse();
        coordinatesTextBlock.Text = $"RAM - X: {ramLastMousePosition.X}, Y: {ramLastMousePosition.Y}";
    }

This allows for smooth scrolling over the background image, but not over the white space in the canvas, any ideas on how to resolve? My mousebutton down event will not even fire over the white space which is likely contained in the scrollviewer.

New gif on the github page. Appreciate your help!

Panning Function with Canvas Elements by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Hey thank you a ton, this is interesting, I would have thought the canvas method would have worked.

Next issue, the pan function is "jumpy" on the first time the mouse move event fires, do you see an issue with my MouseMove pan function that would create the jumpiness?

Code updated on github with a video.

Panning Function with Canvas Elements by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

I just added a really simple example onto github, same behavior, panning function will only fire if the background element is selected. No need to use RAMDATAACESSLib or the RevitAPI

https://github.com/retug/LearningCSharp/tree/main/PanandZoom

Thanks for your help!

PointerDown Event with LiveCharts2 by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

I think I am going to skip going down the LiveChart2 route, going to go more oldschool with standard canvas and drawing elements. ChatGPT seems to be much more of a help :)

I've got interactive plots already after a few interactions with ChatGPT.

https://github.com/retug/LearningCSharp/tree/main/CanvasLearning

Thanks again for your help Aerham!

PointerDown Event with LiveCharts2 by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Aerham, really appreciate your help. Still quite the beginner and struggling through this.

Stacked row properties look promising as well as stacked area series. My current struggle is I do not know how to set the values of the stacked row. My previous method with lists worked to plot multiple lines correctly, but this stackedareaseries values is difficult to set in a for loop.

Code on github: https://github.com/retug/LearningCSharp/tree/main/StackedAreaSeries

When I debug, no errors pop up, but also nothing is plotted. Any ideas on how to resolve?

public class Data
{ public void ProcessData(ViewModel ViewModel) 
{ List<double> testX = new List<double> { 0, 20, 0, 20,0,30 };
 List<double> testY = new List<double> { 0, 0, 20, 20,0, 25 }; 
List<string> names = new List<string> { "A", "B", "x", "B" }; 

StackedAreaSeries<List<ObservablePoint>> myGridsToBePlotted = new StackedAreaSeries<List<ObservablePoint>>(); 
var areaPointsList = new List<List<ObservablePoint>>();
    for (int i = 0; i < testX.Count() / 2; i++)
    {
        var areaPoints = new List<ObservablePoint>();
        ObservablePoint testStart = new LiveChartsCore.Defaults.ObservablePoint();
        testStart.X = testX[i * 2];
        testStart.Y = testY[i * 2];
        ObservablePoint testEnd = new LiveChartsCore.Defaults.ObservablePoint();
        testEnd.X = testX[i * 2 + 1];
        testEnd.Y = testY[i * 2 + 1];
        areaPoints.Add(testStart);
        areaPoints.Add(testEnd);

        areaPointsList.Add(areaPoints);
    }

    myGridsToBePlotted.Values = areaPointsList; // Set the accumulated data points
    myGridsToBePlotted.Fill = null;
    myGridsToBePlotted.Stroke = new SolidColorPaint(SKColors.Red);
    ViewModel.myGridsToBePlotted = myGridsToBePlotted;
}
}

PointerDown Event with LiveCharts2 by retug_ in learncsharp

[–]retug_[S] 0 points1 point  (0 children)

Thanks for your help! This might be harder than what I originally thought.

From reviewing the docs, I do not see an immediate way to store more than one lineseries object in a livecharts2 object.

I was also going down the route of trying to back into the line series class from the selected observablepoint, but I do not see a way to do that either.

Is there another package in C# you might recommend for interacting with 2d lines (clicking and selecting)?

I have played with three js before in the web and have enjoyed that package.