PDA

View Full Version : Drawing objects using 'sendcommand' in VB



40sondacurb
12th Nov 2005, 04:47 pm
Hello,

I am using VB for writing code for CAD drawings
i have drawn an arc in VB using 'Sendcommand'. The command is as below.
--------------------------------------------------------------------------dim acaddoc as acaddocument

acaddoc.SendCommand "_arc" &vbcr &2,3,4" & vbcr & "5,7" & vbcr & "12,10" & vbcr
--------------------------------------------------------------------------
This command is working and giving the output arc
but if i want to change the properties or delete it or do any operation on it during runtime, how is it possible

For eg if line1 is any acadline, then we can use the properties of line as color,endpoint,startpoing,mirror,delete,copy,move etc...... as follows
--------------------------------------------------------------------------
dim line1 as acadline

set line1=acaddoc.modelspace.addline(stpt,endpt)
line1.color=acred
line1.visible=true
line1.highlight(true)
--------------------------------------------------------------------------

if i want to use the same properties for an arc which is drawn using sendcommand how is it possible

Is there any one to help me

thanks in before hand

thanx

rkmcswain
23rd Nov 2005, 07:09 pm
After you create the entity, grab it an assign it to a variable.



Dim lastent As AcadEntity, cnt
cnt = ThisDrawing.ModelSpace.Count
Set lastent = ThisDrawing.ModelSpace.Item(cnt - 1)