.NET

Reply
Contributor
JohnB-HKS
Posts: 16
Registered: ‎02-14-2006
Message 1 of 7 (294 Views)

Inserting blocks with VB.NET

294 Views, 6 Replies
02-15-2006 07:59 AM
Hey Everyone!

I am trying to insert blocks from a user tool with list view into drawings. I seem to be unable to do this on my own. I have looked at many listings here but are still having trouble. Can anyone help? Drag and drop help would be great too!
*Martin Langevin
Message 2 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-15-2006 09:56 AM in reply to: JohnB-HKS
1 - Find is you insert block in model or paper space
2 - Ask to user insertion point. For this use acadDoc.Utility.GetPoint
3 - Insert block

dim objBlock as AcadBlockReference
objBlock = acadDoc.ModelSpace.InsertBlock(Insertion point, path + filename
block, X scale, Y scale, Z scale, Rotation angle)
ex.:
objBlock = acadDoc.ModelSpace.InsertBlock(InsPt,"c:\temp\test.dwg", 1, 1, 1,
0)


a écrit dans le message de news:
5086970@discussion.autodesk.com...
Hey Everyone!

I am trying to insert blocks from a user tool with list view into drawings.
I seem to be unable to do this on my own. I have looked at many listings
here but are still having trouble. Can anyone help? Drag and drop help
would be great too!
Contributor
JohnB-HKS
Posts: 16
Registered: ‎02-14-2006
Message 3 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-15-2006 10:18 AM in reply to: JohnB-HKS
Thanks for the replay!!!!!! what class is acadDoc Under?
*Martin Langevin
Message 4 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-15-2006 11:08 AM in reply to: JohnB-HKS
dim acadApp as AutoCAD.AcadApplication
dim acadDoc as AutoCAD.AcadDocument

Is not class, is just active document of AutoCAD application but in your
reference, add AutoCAD Object Library


a écrit dans le message de news:
5087168@discussion.autodesk.com...
Thanks for the replay!!!!!! what class is acadDoc Under?
Contributor
JohnB-HKS
Posts: 16
Registered: ‎02-14-2006
Message 5 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-15-2006 11:40 AM in reply to: JohnB-HKS
Heres what i've got so fare, I have lookd all thought the class view and still can't find them,



Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Document
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.Colors
Imports Autodesk.AutoCAD.Windows
Imports Autodesk.AutoCAD.Windows.ToolPalette
Imports DBTransMan = Autodesk.AutoCAD.DatabaseServices.TransactionManager
Contributor
JohnB-HKS
Posts: 16
Registered: ‎02-14-2006
Message 6 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-15-2006 12:07 PM in reply to: JohnB-HKS
Ok, I got everything exept how I define the insertion point

Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common


dim InsPt = ?????????????
*Martin Langevin
Message 7 of 7 (294 Views)

Re: Inserting blocks with VB.NET

02-16-2006 01:27 PM in reply to: JohnB-HKS
dim InsPt as Object
Is return
InsPt(0) as X coor.
InsPt(1) as Y coor.
InsPt(2) as Z coor.

a écrit dans le message de news:
5087383@discussion.autodesk.com...
Ok, I got everything exept how I define the insertion point

Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common


dim InsPt = ?????????????
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.