Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can I do this?
It is for entities of Autocad, but alignments are entitites of Autocad?
Public Shared Sub ZoomToEntity( _
ByVal entityId As ObjectId)
Dim db As Database = Application. _
DocumentManager.MdiActiveDocument.Database
' start transaction
Using trans As Transaction = db. _
TransactionManager.StartTransaction()
' get the entity' extends
Dim ent As Entity = trans.GetObject( _
entityId, OpenMode.ForRead)
Dim extends As Extents3d = ent.GeometricExtents
' configure the new current view
ZoomToWindow(New Point2d( _
extends.MinPoint.X, _
extends.MinPoint.Y), _
New Point2d( _
extends.MaxPoint.X, _
extends.MaxPoint.Y))
trans.Commit()
End Using
End Sub
' the command for database extension
<CommandMethod("zextends")> _
Public Shared Sub ZoomExtends()
Dim db As Database = Application. _
DocumentManager.MdiActiveDocument.Database
'get the database extension's points
ZoomToWindow(New Point2d( _
db.Extmin.X, db.Extmin.Y), _
New Point2d( _
db.Extmax.X, db.Extmax.Y))
End Subhttp://adndevblog.typepad.com/autocad/2012/07/implementing-zoom-commands-with-net.html
Other way could be this:
public static void ZoomObjectoSeleccionado(Autodesk.AutoCAD.DatabaseServices.ObjectId[] matriz)
{
Autodesk.AutoCAD.Internal.Utils.SelectObjects(matriz);
Autodesk.AutoCAD.Internal.Utils.ZoomObjects(false);
System.Windows.Forms.Application.UseWaitCursor = false;
}But with zoom I don´t want to select alignment.
Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS
Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS
Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Solved! Go to Solution.