Hi,
I cannot find this value mentioned in the SDK (InRoads SDK help) anywhere, can you help me find it?
In ALG-files, each alignment (An alignment is basically a complexchain) can have a "state" value string set. I know that because if I look in a LandXML file (an XML export of an ALG), there is a state value.
Since the LandXML files originate from microStation via inRoads/PowerCivil, the "state" value has to be there somewhere.
State as shown in LandXML:
<Application name="Bentley InRoads V8i (SELECTseries 2)" manufacturer="Bentley Systems, Inc." version="08.11.07.615" manufacturerURL="www.bentley.com" /> <Alignments> + <Alignment name="XXX" length="2395.1086749" staStart="33592.6860545" desc="XXX" state="proposed"> ... </Alignment> </Alignments>
State definition in LandXML:
<xs:simpleType name="stateType"> <xs:restriction base="xs:string"> <xs:enumeration value="abandoned" /> <xs:enumeration value="destroyed" /> <xs:enumeration value="existing" /> <xs:enumeration value="proposed" /> </xs:restriction> </xs:simpleType>
I would assume that the SDK function to get alignment information would return the state string, but it doesn't:
#include <SCadCogo.h> int scadSDK_cogoAlignmentInfoGet ( wchar_t *name, // (o) alignment name (size is ALGNAMSZ) wchar_t *desc, // (o) alignment description (size is ALGDSCSZ) wchar_t *style, // (o) alignment style (size is ALGFTRSZ) ALGalign *alg // (i) pointer to alignment );
name
desc
style
NULL
Apologies if you would prefer this question in another forum.
If there is no API function to read the state, then you can roll your own in VBA.
<Alignment name="XXX" length="2395.1086749" staStart="33592.6860545" desc="XXX" state="proposed"> </Alignment>
You can parse XML by adding a reference in VBA to Microsoft XML (MSXML6). That gives you the tools to query XML and extract attribute information such as state. MSXML6 is installed with MicroStation V8i.
Regards, Jon Summers LA Solutions
Thanks Jon,
I need to know how to pull the "state"-parameter out of an inRoads ALG-file.
Reading my question, I realize it was prone to interpretation. XML-parsing is however, not the issue. The XML is just where I saw that the "state"-parameter had to exist in the ALG-files. The ALG-files are "Bentley binary black boxes" - Sorry for the confusion.
System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.
Unknown said:I would like to get VBA macro to draw a line at a specifice station on an alignment
Please post that question in a new thread. It is not related to this thread's topic.
It's not clear by 'I would like to get VBA macro' whether you plan to write your own VBA macro or that you hope somebody already created that functionality.