Select alignment string vs code

Hi all,

Trying to understand why selection of alignment on-screen to get the alignment name as a string
doesn’t work, when the pasted name of the alignment name works.

Any ideas?

GET alignment name 1.pdf (62.3 KB)
select-alignment-PROFILE Report to excel.dwg (2.1 MB)
select-alignment-PROFILE Report to excel.dyn (53.4 KB)

I’m not an expert, but the output from the Name node is a list containing a Name…

Perhaps the Alignment node only takes a single Name? If you get the first item from the list does it work?

Hope that helps,

Mark

1 Like

You’re way more likely to get responses if you share a screenshot of your graph in action, with all the information we need to understand your process, rather than relying on everyone else to download and run your graph (which can lead to assumptions, varying package versions, and other differences in outcome).

1 Like

(EDIT: See Mark’s post above and Nick’s post below, data type is a red herring)

Screenshot of your PDF of a screenshot below:

(With the caveat I know nothing about Civil3d and it’s data structure/object model)

Is “Alignment Name” actually a string?
I mean, it looks like a string, but the Selection.AlignmentByName node is looking for “Name” as an input, which may be a data type or property, rather than the actual text value of that name…

(If that makes any sense)

Joe,

Thanks for reply,

I thought a name was a string, but maybe you right. it’s works fine with typing the name, just thought it should have worked. I’ll look and see if there is a node for alignment name, I’d rather select the alignment than type its name.

Thank you all

Thanks Joe,

When I use the alignment dropdown it works, I did notice the civilobject.name changed from it looks like a list to string, even when the output of the civilobject.name says it’s a string. that must be why it didn’t work.

GET alignment name 3

As @Mark.Ackerley mentioned, it’s likely the list structure. All the ways that have worked have been with a single item. The original failed state was when you used Select Objects (plural). This was returning a list of strings instead of a single string.

You probably just need to use list levels or a method for a single object selection if you’re only ever using a single object at a time.

1 Like

Nick,

Thanks, I didn’t notice that, I thought if I only selected one item to would pass that string, I see what your saying now.
Thank you

1 Like