mariano.boi
Guest
Hello everyone,
I wrote code to turn a circle into polyline,
to do this, with the command thisdrawing.sendcommand "divide", I created points by selecting circle.
until here everything is fine, but when I have to select points to create polylinea, they are not selected.
place below code:
I ask you if you can find some other solution.
of course the command will be shared to the whole forum.
Thank you in advance.
Marian
ps: I am using autocad 2012
I wrote code to turn a circle into polyline,
to do this, with the command thisdrawing.sendcommand "divide", I created points by selecting circle.
until here everything is fine, but when I have to select points to create polylinea, they are not selected.
place below code:
Code:
private function circle_point() as acadselectionset
dim setdivss as acadselectionset
on error resume next
if not isdbnull(thisdrawing.selectionsets.item("dividess")) then
setdivss = thisdrawing.selectionsets.item("dividess")
setdivss.delete()
end if
setdivss = thisdrawing.selectionsets.add("dividess")
setdivss.selectonscreen()
for each ojarc in setdivss
ojarc.color = acad_color.acyellow
next
return setdivss
end function
private sub divide_circle(byval ojarc as acadentity)
dim div as integer
dim commandstr as string
div = thisdrawing.utility.getinteger("numero dividenti: ")
commandstr = "_divide (handent """ + ojarc.handle + """" + ")" & vbcr & div & vbcr
if noofpeaces = 1 or noofpeaces = 0 then
else
thisdrawing.sendcommand(commandstr)
end if
end sub
<autodesk.autocad.runtime.commandmethod("arcdiv")> _
public sub divcirc()
dim newsset as acadselectionset
dim setdivss as acadselectionset
dim filtype(0) as short
dim fildata(0) as object
setdivss = circle_point()
divide_circle(setdivss.item(0))
on error resume next
if not isdbnull(thisdrawing.selectionsets.item("newselset")) then
newsset = thisdrawing.selectionsets.item("newselset")
newsset.delete()
end if
newsset = thisdrawing.selectionsets.add("newselset")
newsset.select(acselect.acselectionsetall,,,filtype,fildata)
msgbox(newsset.count)
end sub
dim commandstr as string</autodesk.autocad.runtime.commandmethod("arcdiv")>
of course the command will be shared to the whole forum.
Thank you in advance.
Marian
ps: I am using autocad 2012