Monday, 28 October 2024
  5 Replies
  1.1K Visits
0
Votes
Undo
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!
Accepted Answer
0
Votes
Undo
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
1 month ago
·
#7146
0
Votes
Undo
Gotcha,

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

Thanks!
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
1 month ago
·
#7139
0
Votes
Undo
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.
1 month ago
·
#7128
0
Votes
Undo
Perfect! That is exactly what I was looking for. Thanks!
Paul Wilson selected the reply #7124 as the answer for this post — 1 month ago
Accepted Answer
0
Votes
Undo
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
Paul Wilson set the type of the post as  Task — 1 month ago
  • Page :
  • 1
There are no replies made for this post yet.