Options Get the name off the Exportfolder in Informed design
too export preview picture from APS/Informed Design
ExportFilesDir = System.IO.Path.GetDirectoryName(ThisDoc.Path) & "\ExportFiles" ''' Radera ExportDir om den existerar If System.IO.Directory.Exists(ExportFilesDir) = False ' System.IO.Directory.Delete(ExportFilesDir, True) ''' Skapa ExportDir System.IO.Directory.CreateDirectory(ExportFilesDir) End If For Each deleteFile In System.IO.Directory.GetFiles(ExportFilesDir ,"*.jpg") System.IO.File.Delete(deleteFile) Next ''' Create JPG Dim fileName As String = System.IO.Path.GetDirectoryName(ThisDoc.Path) & "\ExportFiles\Liftboy.jpg" ' Get the active document Dim oDoc As Document = ThisDoc.Document Dim oModelRef As Document = ThisDoc.Document Dim options As DisplayOptions = ThisServer.DisplayOptions options.UseDocumentDisplaySettings = True options.Show3DIndicator = False Dim camera As Camera= ThisServer.TransientObjects.CreateCamera camera.SceneObject = oModelRef.ComponentDefinition ' If side_exit_on_upper_landing = "Yes - on left side" Or side_entry_on_lower_landing = "Yes - on right side" ' camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation ' Else If side_exit_on_upper_landing = "Yes - on right side" Or side_entry_on_lower_landing = "Yes - on left side" ' camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopLeftViewOrientation ' Else ' camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation ' End If Dim tg As TransientGeometry tg = ThisServer.TransientGeometry Dim eyeDistance As Double eyeDistance = 30 ' Calculate the x and y coordinates of the eye. Dim x As Double Dim y As Double x = 750 y = 1500 ' x = eyeDistance * Cos(1 / 1 * (2 * pi)) ' y = eyeDistance * Sin(1 / 1 * (2 * pi)) ' Set the eye using calculated x, y and a hard coded z value. If side_exit_on_upper_landing = "Yes - on left side" Or side_entry_on_lower_landing = "Yes - on right side" camera.Eye = tg.CreatePoint(-x, -y, 1000) Else If side_exit_on_upper_landing = "Yes - on right side" Or side_entry_on_lower_landing = "Yes - on left side" camera.Eye = tg.CreatePoint(-x, y, 1000) Else camera.Eye = tg.CreatePoint(-x, -y, 1000) End If ' Define the up vector as positive z. camera.UpVector = tg.CreateUnitVector(0, 0, 1) camera.Perspective = True camera.Fit camera.Apply() camera.ApplyWithoutTransition Dim topClr As Color= ThisServer.TransientObjects.CreateColor(255, 255, 255) Dim bottomClr As Color= ThisServer.TransientObjects.CreateColor(255, 255, 255) camera.SaveAsBitmap(fileName, 5000, 5000, topClr, bottomClr) options.UseDocumentDisplaySettings = False options.Show3DIndicator = True
Can't find what you're looking for? Ask the community or share your knowledge.