Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi!
i want to draw displaymodels of topobase-data and create following code base on agu-Deutschland help.
Public Sub DrawDM(Document As Autodesk.Map.IM.Forms.Document, Optional ByVal Silent As Boolean = True)
Dim DM_Name As String = "O:\Map2015-Darstellungsmodelle\ALKIS 20170125\ALKIS für DWG.tbdm"
Dim Msg As String = ""
Dim acDocMgr As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
Dim acDoc As Autodesk.AutoCAD.ApplicationServices.Document = acDocMgr.MdiActiveDocument
If System.IO.File.Exists(DM_Name) = False Then
If Silent = False Then
MsgBox("Darstellungsmodell nicht gefunden!", MsgBoxStyle.Critical, k_AppName_Vermessung)
End If
Exit Sub
End If
If IsNothing(Document) Then
If Silent = False Then
MsgBox("Es ist kein Dokument zugewiesen!", MsgBoxStyle.Critical, k_AppName_Vermessung)
End If
Exit Sub
End If
Dim graphicsGenerator As Autodesk.Map.IM.Display.GraphicsGeneration.IGraphicsGenerator
Try
graphicsGenerator = Document.Application.Services.GetService(Of Autodesk.Map.IM.Display.GraphicsGeneration.IGraphicsGenerator)()
'Bildaufbau
Dim displayRepository As Autodesk.Map.IM.Display.DisplayModelManagement.IDisplayModelRepository
displayRepository = graphicsGenerator.DisplayModelRepository
Dim RepositoryPath As String
RepositoryPath = graphicsGenerator.DisplayModelRepository.RepositoryDirectory.ToString()
graphicsGenerator.DisplayModel = displayRepository.Load(DM_Name)
'graphicsGenerator.DisplayModel = displayRepository.Load(RepositoryPath + "\" + "MeinDarstellungsmodell.tbdm")
graphicsGenerator.ShowProgressBar = True
Dim mydocuments As System.Collections.Generic.ICollection(Of Autodesk.Map.IM.Display.GraphicsGeneration.IDocument)
'acDoc As Autodesk.AutoCAD.ApplicationServices.Document
Dim docLock As DocumentLock = acDoc.LockDocument
Using docLock
mydocuments = graphicsGenerator.Draw
End Using
Catch ex As Exception
Dim TryReport As New EBL.Service.TryCatchReport
TryReport.Show("unerwarteter Fehler in EBL.Import.SielVerm > VermSielPunktImport", ex.ToString)
Finally
graphicsGenerator.ShowProgressBar = False
End Try
End Sub
in this code the complete area will draw.
question 1:
is there a way to define a area to draw like the Topobase function in the Dialog?
question 2:
the draw process in dwg1 is ok
when i open a secound dwg (dwg2) the dwg-title will show dwg1 and it looks like the data will Import to dwg1 - but finally the data are correct into dwg2 draw.
did you have a idea of reason for this phänomen?
reagards Jan
Solved! Go to Solution.