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

any suggestions?

  • Thread starter Thread starter Shape
  • Start date Start date
...I swear I'm trying to get under my head, but with the vba still under my hand I can't really make my life complicated by my cube... grgrgrgrgrggrgr
Shut up and study without complaining, which then we will give you many exercises to do at home! :biggrin:
 
Shut up and study without complaining, which then we will give you many exercises to do at home! :biggrin:
I'm trying to osmosis. but it doesn't seem to work much! :confused:
6360757-uomo-contenere-un-computer-portatile-come-un-tetto-di-casa-isolated-on-white-programmatore-allegro-g.jpg
but there is to say that besides various "against" vb.net seems a little stable being even more rigid and messed up at the cube.
 
how to access layers to display their properties:
Code:
private function get_layxdata() as array
        dim myxdata as array = nothing
        using db as database = thisdatabase
            using tr as autodesk.autocad.databaseservices.transaction = tr_start
                using lt as layertable = tr.getobject(db.layertableid, openmode.forread)
                    using r as layertablerecord = tr.getobject(lt("0"), openmode.forread)
                        if r.xdata <> nothing then
                            myxdata = r.xdata.asarray
                        end if
                        tr.commit()
                    end using
                end using
            end using
        end using
        return myxdata
end function
in this specific example I ask the xdata attached to the layer "0"

Say hi.
 
I know it's an old post but since there is so little documentation in Italian I would like to emphasize the complexity of vb.net,
while with vba to create a line we wrote:
Code:
sub addline()
    dim ptstr(0 to 2) as double
    ptstr(0) = 5: ptstr(1) = 5: ptstr(2) = 0#
     dim ptend(0 to 2) as double
    ptend(0) = 12: ptend(1) = 3: ptend(2) = 0#
 
    ' create a line object in model space
    dim lineobj as acadline
    set lineobj = thisdrawing.modelspace.addline(ptstr, ptend)
 
end sub
with vb.net you have to write. . .
Code:
imports autodesk.autocad.runtime
imports autodesk.autocad.applicationservices
imports autodesk.autocad.databaseservices
imports autodesk.autocad.geometry
 
<commandmethod("addline")> _
public sub addline()
  '' get the current document and database
  dim acdoc as document = application.documentmanager.mdiactivedocument
  dim accurdb as database = acdoc.database
 
  '' start a transaction
  using actrans as transaction = accurdb.transactionmanager.starttransaction()
 
      '' open the block table for read
      dim acblktbl as blocktable
      acblktbl = actrans.getobject(accurdb.blocktableid, openmode.forread)
 
      '' open the block table record model space for write
      dim acblktblrec as blocktablerecord
      acblktblrec = actrans.getobject(acblktbl(blocktablerecord.modelspace), _
                                      openmode.forwrite)
 
      '' create a line that starts at 5,5 and ends at 12,3
      dim acline as line = new line(new point3d(5, 5, 0), new point3d(12, 3, 0))
 
      acline.setdatabasedefaults()
 
      '' add the new object to the block table record and the transaction
      acblktblrec.appendentity(acline)
      actrans.addnewlycreateddbobject(acline, true)
 
      '' save the new object to the database
      actrans.commit()
  end using
end sub</commandmethod("addline")>
So?
stay in vba until you can that is a more "user friendly" language

Anyway I'm starting to make libraries (.dll) to load in nanocad
written and compiled in ms visualstudio (free)
if you need a hand make a whistle
 

Forum statistics

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

Members online

No members online now.
Back
Top