Good Afternoon,
I have been fiddling with some alignment commands in the Inroads SS2 SDK and have had some trouble getting a list of alignment pointers from the scadSDK_cogoGetHorizontalAlignments. I have tried multiple things to use this including: using the function as written in the SDK, Modify the SDK function to take an array and modifiy this SDK funtion to take a string. None have worked. Here is my code.:
Sub Get_Alignment_List()
'scadSDK_cogoCountNumberOfHorizontals Lib "SCadSDKAT" (ByVal prj As Long) As Long
'scadSDK_cogoGetHorizontalAlignments Lib "SCadSDKAT" (hAlg As Long, Count As Long, ByVal prj As Long) As Long
Dim oProj As Long
Dim oFlag As Long
Dim oCount As Long
Dim oALG As Long
oProj = 0
oCount = scadSDK_cogoCountNumberOfHorizontals(oProj) 'Gets the number of alignments in the project, needed as input.
Debug.Print oProj 'Prints the value of oProj to see if it has changed (it doesn't)
Debug.Print oCount 'Prints the number of Alignments in the active project.
oFlag = scadSDK_cogoGetHorizontalAlignments(oALG, oCount, oProj)
Debug.Print oALG ' print the alignement pointer
End Sub
My desire is to build a list of alignment names for a use to select from. I have a work sub to get then name of the active alignment so it should be simple to modify that once i get the alg pointer i need.
Here is the SDK help file for the function.
scadSDK_cogoGetHorizontalAlignments
#include <SCadCogo.h> int scadSDK_cogoGetHorizontalAlignments ( ALGalign **hAlgs, // (i/o) pre-allocated alignment list int *cnt, // (i/o) number of alignments in list ALGproject *prj // (i) geometry project );
Description: | This function populates a list, hAlgs , with pointers to all of the horizontal alignments within the specified project. Passing NULL for prj will indicate to the function to use the active geometry project. The list must be pre-allocated by the user, and the cnt must be set to the size of hAlgs before being passed in. The value of cnt returned will be the number of pointers actually stored in hAlgs . |
---|
The term list confuses me. As a non-C programmer i don't understand how this type works. It seems to me that a list is an array but in other functions the return value of a list is a string type with individual characters separated by the ascii version of a null.
Any help would be great.
Thanks,
Jason