By Paul Wilson on Monday, 28 October 2024
Posted in Customization
Replies 5
Likes 0
Views 808
Votes 0
Hi all,

I have a plugin that I built that handles plant label arrangement and creation. I want it to access landFX properties like "size" or "code". I am working in c#. Is there a library reference that I can use in visual studio to access LandFX properties and commands? ChatGPT said this exists, but I think it was Hallucinating.

Thanks In advance!
Paul,

The plant code, size, and all other data is stored as Xdata, under the registered application LandFX.
Unfortunately the documentation for C# is really lacking, the best I could find is this:

https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_DBObject_XData

—J
·
3 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect! That is exactly what I was looking for. Thanks!
·
3 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I have another quick question.

I am able to read block properties now, no problem. I am now trying to write a small Class with functions that can send basic LandFX operations to the command line as strings.

Currently I am trying so attach LandFX leaders to a group of landFX blocks. I have to specifically use landFX leaders so that the "Verify Labels" command will still work.

I am trying to run "FX_PLANTLABELSINGLE" through the command line using strings as arguments. I think my formatting is correct. The first argument (select block) goes in just fine. The second one ( Specify leader landing location ) throws an error.

This morning I was working in autoCAD and I noticed that that when the FX_PLANTLABELSINGLE is run in the command line when you pick a block it returns "Invalid Input" in the command line. The second part of the command only prompts at the cursor not at the command line.

can the entire command be run through the command line or does this have to be done some other way?
currently I am trying to send it as

string command = $"FX_PLANTLABELSINGLE {blockString} {selectedPointString} ";
doc.SendStringToExecute(command, true, false, false);

Any suggestions. Do I need to be working in c++ instead to reach LandFX commands?
Can this be done in autoLisp? I can call Lisp in C# I think.
·
2 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Paul,

Our plant label tools are not set up to be scripted like that.
You would have to create the label and add the correct xdata to it.

--J
·
2 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Gotcha,

I will look at the XData on the labels and see if I can recreate them.

Thanks!
·
2 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post