Visual Basic Customization

Visual Basic Customization

Reply
*Sukru Baykan
Message 1 of 4 (459 Views)

Measure or divide command in vba

459 Views, 3 Replies
04-06-2005 11:53 PM
I want to insert a block along a polyline like measure or divide command. Is there a way to use these commands in vba ? Sukru Baykan
Active Member
tproby
Posts: 7
Registered: ‎02-22-2011
Message 2 of 4 (446 Views)

Re: Measure or divide command in vba

02-24-2011 10:23 AM in reply to: *Sukru Baykan

Also need this functionality but looking at other posts, it seems you have to use LISP.

New Member
truss85
Posts: 2
Registered: ‎02-23-2011
Message 3 of 4 (431 Views)

Re: Measure or divide command in vba

02-24-2011 11:19 PM in reply to: *Sukru Baykan

first of all

you need to insert block command I send an example...

then you specified the coords. of the where the block inserted.

along a polyline I suggest get coordinate method.

if you describe your problem with details, I can help with further imformation.

here is insert block example which already existed in acad

sub is add block to (0,0,0) coordinate, you can modfiy to polyline coordinates..

 

Sub block_ekleme()
    Dim blocknesnesi As AcadBlockReference
    Dim kesisim(0 To 2) As Double
    kesisim(0) = 0: kesisim(1) = 0: kesisim(2) = 0
    Set blocknesnesi = ThisDrawing.ModelSpace.InsertBlock(kesisim, "blo", 1#, 1#, 1#, 0)
    ZoomAll
End Sub

 

Valued Contributor
bojko108
Posts: 61
Registered: ‎01-23-2011
Message 4 of 4 (422 Views)

Re: Measure or divide command in vba

02-25-2011 03:30 AM in reply to: *Sukru Baykan

it is fairly easy to do mathematically. Here is one example. It is maybe little complex :smileyhappy: but will give you directions how to do it. There is a way with SendCommand() method but I don't know how it works. Look in Help Menu there is plenty of examples

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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