How do I pass a .lsp argument to my C# Addon command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am patching together a combination of .lsp and C# for an Advance Steel Addon. I'm including the .lsp front end only because I already have the user defined functions and a working copy of code to read the contents of an Excel file. I want to pass the contents of a single cell that is returned by the .lsp to the C# portion of this 'combo-Addon'. The purpose is to have a document that is easy to edit [Excel] that pairs EU steel shapes with US steel shapes and covert/draw between the two.
My C# code for now is expecting a string from .lsp as an argument and displaying that with MessageBox.Show. My C# code for doing this is:
using System;
using System.Collections.Generic;
using Autodesk.AdvanceSteel.CADAccess;
using Autodesk.AdvanceSteel.DocumentManagement;
using Autodesk.AdvanceSteel.Runtime;
using System.Windows.Forms;
namespace OE_DrawSteel
{
public class EUtoUS
{
[CommandMethodAttribute("DRAWSTEEL_GROUP", "_DrawSteel", "_DrawSteel", CommandFlags.Modal)]
public void DrawSteel( string shape )
{
MessageBox.Show(shape);
}
}
}
Everything builds without error.
I can successfully load the .dll file with [Command: ASTORLOADASNETPLUGIN].
And I have a DRAWSTEEL command in AS.
How do I call this with the argument that I am trying to display with MessageBox.Show?
I have tried all kinds of combinations on the AS command line with what I have.
Do I need to define
public void DrawSteel( string shape )
as something different than a void type with a string argument?
The ultimate goal is to:
-- pull string values from Excel and make lists of lists of lists with .lsp
-- feed that into a .lsp dialog popup_list to make selection of EU steel shape and convert to US shape
-- using .lsp, call the C# Addon with the string argument of the US shape
-- draw the US shape in Advance steel
Any ideas?
Should I ditch the .lsp and rewrite the Excel harvest in C# to eliminate the need to pass a variable?
Thanks to all that read this far,
Chris