Hi guys im new here and im absolutly new to SE too.
I have the task to programming a small programme which gets the dimensions of a 2D draft incl. sufix, prefix and tolerances.
With the dimensions i want to create an report.
Is it possible to get these information and copy them to eg a excel document or directly in the cache memory ?
Im able to get the properties form a file but i dont know how i can get the dimensions.
Hope anybody of u can help me, thx!
Posted by: Bob SanchezPost date: 11/16/2008 9:35:32 PM
I am working on a similar task.
As far as I know (I am all but an expert in SE programming!), you can do this in two different ways:
- you can access the Variable Table;
- you can access directly the Dimensions collections.
If you are working on a 2D file, I feel it is easier to access the ActiveDocument.ActiveSheet.Dimensions collection (this is the way I chose).
Here below I am pasting a portion of code that could help you:
Dim objDoc As DraftDocument
Dim objSheet As Sheet
Dim objDims As Dimensions
Dim xlWkbk As Object
xlWkbk = GetObject(dbName) 'opening the destination Excel file as database of dimensions
objDoc = objApp.Documents.Open(dftFilePath)
objSheet = objDoc.ActiveSheet
objDims = objSheet.Dimensions
For i = 1 To objDims.Count
myDimValue=objDims.Item(i).Value 'this value is always returned in SE internal units
'meter for distance
'any useful instruction to store your myDimValue in an array or to write it in a file
'the following loop is very important if you want to process several files in a for loop
'Solid Edge could frequently crash if you do not release resources properly
Do While Marshal.ReleaseComObject(objDims.Item(i))
Do While Marshal.ReleaseComObject(objDims) 'see similar comment above
objDims = Nothing
Do While Marshal.ReleaseComObject(objSheet)
objSheet = Nothing
objApp.DoIdle() 'supposed to give Solid Edge the time to close its file
objFile = Nothing
'any instruction to save and close your Excel destination database, if required
Posted by: Alessandro RaggiPost date: 1/2/2009 5:46:36 AM
maybe someone has an example, how export dimension value to excel ?
copytoclipboard doesnt work for dimension.value