• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

selectall, new created objects

  • Thread starter Thread starter mariano.boi
  • Start date Start date

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:
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")>
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'm sorry, Marian, I can't help you, but I wonder what this command is for? you get something similar with native tools of autocad in less than 5 seconds.. .
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top