• 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

Shape

Guest
beyond the various tutorials (to say the real few) that are on the net, there is no one who has some advice on how to take this "new" language applied to autocad obviously.

Why is it so different from the visual basic that we are used to using on autocad?

How is it taken?

Maybe some practical examples on the various operations that normally run in autocad, draw lines, create selections, change something.

but above all how a project should be structured.

I know that they are several questions all thrown there, I started from 0 even with the visual basic and eventually I came out well but with the .net cabbage I am still planted at the "hello world" ......
 
hello
I would also like to go to the net, but...
I bought, I think the only book dedicated to autocad programming with net
here. http://www.vbcad.com/ to the problem of interpreting a technical English but slowly you arrive, it also puts a template with the initial settings to load the libraries and set the environment etc.
the problem of net, language to what is said very powerful, safe etc.
is a language almost exclusively for professional programmers, just this morning I read this article http://www.cadalyst.com/cad/autocad/the-world-autocad-programming-platforms-part-1-14398 where it confirms how much you already knew, abandoning the vba, you maintain the vlisp as language for us lines and you push for the net.
I believe that we users should ask in chorus to update the dcl of the lisp, for various reasons:
1) even tyrants continue to customize their cad more professionally.
2) but the most important thing of these lean times, if you update the dcl of the lisp, could arise many specific sectoral explanations, created by those who have the experience on the field, which is very difficult to transfer to a programmer (experienced).
it would also increase the market by probably creating jobs etc.
Hi.
 
in fact I think that the choice made in its time vba rather than lisp was wrong.
now abandoning the vba I will be forced to "remake" everything in lisp, the vb.net for the moment and for my knowledge it turns out inaccessible.

even if it is not clear to me how ever microsoft has reclaimed the change by not abandoning the vb while autodesk insists on giving it definitively.
 
autodesk has abandoned the vba because it only works at 32 bits, at 64 creates huge problems.
microsoft left the vba and no longer develops it, therefore they are forced to this choice.
.net is a platform within which you can use various languages, vb c c++
j# etc. (may be that you can also use the lisp, seehttp://it.wikipedia.org/wiki/microsoft_.net#linguaggi_di_programmazione_.net)
therefore seems to be an interpreter of these languages.
Now I have not explained to you in technical domains all but I have the impression that microsoft copied java also this is a platform in which you can use various languages.
 
vba also works 64bit as vba enabler there is also for 64bit :wink:
microsoft also continues to support vba in its office products even at 64bit. :cool:

what I find little practical in the passage to .net is that to make 4 simple lines or points I put 5min clock while in vba I put 5 sec. I don't have to fill in, use 2 very heavy programs, create all references to libraries.
then in the end big differences between vba and vb.net are not there.

I understand if they had to do real programs over autocad, but to do iterative procedures I think vba is still very powerful. In addition, those who use vba for excel or other do not put much to develop on autocad :smile:
visual lisp should be revisited, too old ... and little visual!

In short, I think vba is still comfortable and as long as I can use it.

When they take it off, I'll take the porting... maybe at that time they'll automate the procedures:wink:
 
Hello.
I have read vs. post, I have started with vb.net for a few weeks, so I join the choir.
following only the indications I found in the forum discussions some elementary procedure I managed to execute it.
certainly the vba, which I know so and so, is very practical, vb.net is much longer and macchinoso, considering that however this is the orientation of autodesk for how I see it is better to start and address the topic, the microsoft environment combined with autocad allows to obtain remarkable results.
There will be tribulations, ...... and not little.
I attach this little procedure "command: now" , I saw that shape asked for some practical example, it is very simple, ... if it can serve.

ps : how do you attach a .dll?? :confused:
 
here you can find autodesk tutorials to start learning vb.net:
http://usa.autodesk.com/adsk/servlet/index?id=18162650&siteid=123112
tutorials are good, but what is missing (or missing) of the vba is the help on using various commands and procedures, with the vba even if you do not know how to use the help or library and see syntax examples and then somehow you always get out.

here start by saying loads the library then use these references etc... but they take for granted many things that only a "real" programmer knows. in my opinion they are cutting out those that like us use languages to facilitate work, and they are complicating it remarkably.
 
shape sorry the delay.
are two problems I encountered in vbnet vs vba development:
1) having a x64 machine, the code in debug, when I pause it, nn is editable.
This can be done by completing the x32 architecture code.
2) I precluded every debug operation because I must always load the dll compiled in autocad with netload , so I exit from the visual environment with all its qualities (as said edit on -time ,watch variables, code execution in the immediate window... we have understood)
I found here today. http://usa.autodesk.com/adsk/servlet/index?siteid=123112&id=18162797 what should be the panacea to our evils is a template for autocad .... so do debug as in vba
I tried it on express 2008 but it gives me an error (in the description it is written that for autocad2012 I need express 2010 )
Now I'm downloading this version,starin a viodi.
Sergio
 
updated to vb2010: the post #13 plugin works and we have the on-time debug. Great! !
 
after a little blood from the nose to force of squffions slowly comes out "almost" wellhttp://images.autodesk.com/adsk/files/autocad_2010_dotnet_training.zip
Thanks, this tutorial is just the manna, starting from getting you to understand how the command is rigged, and knowing how you were doing in vba you know you have to forget everything.

I was sanding just because I was trying to recover qlc of known instead here you really have to start from "hello word".

:finger:

mandi furlan!!!
 
to begin with I put forward hands professing my ignorance in this matter.
list a number of considerations, as a point for discussion.
The idea I've done is that with vbnet you can work very similar to the vba, with the small difference that objects (by understanding lines, strings etc) are "hidden" within a structure of matrioske that leave unpolished.

I would like to expose this part of code:
Code:
autodesk.autocad.editorinput imports
imports autodesk.autocad.databaseservices
autodesk.autocad.runtime imports
imports autodesk.autocad.geometry
autodesk.autocad.applicationservices
import dbtransman = autodesk.autocad.databaseservices.transactionmanager
#1 to be inserted at the beginning of the module/class, which are shortcuts to the various sectors (namespace) of the autocad libraries to be uploaded as a reference.
in the sense that instead of writing autodesk.autocad.databaseservices.database
we can write directly
database to retrieve that object.

with vba we were accustomed to maneuvering the drawing objects directly from thisdrawing.modelspace,in vbnet is just like messed up at the cube.
I created other shortcuts:
Code:
friend readonly property thisdrawing() as document
        get
            return docman.mdiactivedocument
        end get
    end property
    friend readonly property lockdoc() as documentlock
        get
            return thisdrawing.lockdocument(documentlockmode.write, nothing, nothing, true)
        end get
    end property
    friend readonly property tr_start() as transaction
        get
            return thisdrawing.transactionmanager.starttransaction
        end get
    end property
    friend readonly property thisdatabase() as database
        get
            return thisdrawing.database
        end get
    end property
    friend readonly property docman() as documentcollection
        get
            return autodesk.autocad.applicationservices.application.documentmanager
        end get
    end property
    friend readonly property edi() as editor
        get
            return thisdrawing.editor
        end get
    end property
so you have thisdrawing almost like once.
here comes the speech of the matrioske to get to the objects:
Code:
friend sub lineshow()
        dim acdoc as document = thisdrawing
        using docloc as documentlock = lockdoc
            dim db as database = thisdatabase
            using tr as transaction = tr_start
                using dict as dbdictionary = tr.getobject(db.groupdictionaryid, openmode.forread, true)
                    for each gp as dictionaryentry in dict
                        dim grp as group = ctype(tr.getobject(gp.value, openmode.forread), group)
                        dim myids() as objectid = grp.getallentityids()
                        for each id as objectid in myids
                            using obj as object = tr.getobject(id, openmode.forwrite)
                                using myent as entity = ctype(obj, entity)
                                    myent.visible = true
                                end using
                            end using
                        next
                    next
                    tr.commit()
                end using
            end using
        end using
    end sub
this small but juicy sub makes all objects visible in the current modelspace (ok,ok before we should have hidden them... Don't do lazy, it's an example.
Be careful that before you do a filter so you only act on objects that are part of a group (you can bypass that part to act on all objects... )

This is an example of how to get to the entity (which can be line , circle etc. just change ctype (obj, entity) (I recommend using the if typeof syntax (obj) is polyline then ..... to get specific types of entities)

if there are any questions, available.
 
to begin with I put forward hands professing my ignorance in this matter.

if there are any questions, available.
to the face of the girl... You're ahead of the cube!

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. grgrgrgrgrggrgr
 

Forum statistics

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

Members online

No members online now.
Back
Top