Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Patriiick

Pages: 1 ... 4 5 [6]
.NET newbies / Explicitly specify .NET 2.0 framework in AutoCAD config
« on: November 19, 2010, 07:47:20 PM »
If you run into trouble when trying to run your .NET programs with AutoCAD, it may be because AutoCAD does not use the correct version of the Framework. If so, follow the instruction in the following config file located in C:\Program Files\AutoCAD 2009\acad.exe.config

Code: [Select]
<!--We always use the latest version of the framework installed on the computer. If you
are having problems then explicitly specify .NET 2.0 by uncommenting the following line.
<supportedRuntime version="v2.0.50727"/>
<!--All assemblies in AutoCAD are fully trusted so there's no point generating publisher evidence-->
<generatePublisherEvidence enabled="false"/>   

This site / This site on a mobile device
« on: November 19, 2010, 03:31:15 PM »
Navigating on this site using a mobile device is easier if you use this URL:

See also.

Visual Studio environment / What is Visual Studio?
« on: November 19, 2010, 01:28:12 PM »
Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all platforms supported by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework, .NET Compact Framework and Microsoft Silverlight.

Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every level—including adding support for source-control systems (like Subversion and Visual SourceSafe) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle (like the Team Foundation Server client: Team Explorer).

Visual Studio supports different programming languages by means of language services, which allow the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. Built-in languages include C/C++ (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual Studio 2010[2]).

source: Microsoft Visual Studio. (2010, November 18). In Wikipedia, The Free Encyclopedia. Retrieved 12:27, November 19, 2010, from

Visual Basic language / What is Visual Basic (VB)
« on: November 19, 2010, 01:26:04 PM »
Visual Basic (VB) is the third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. Because of its graphical development features and BASIC heritage, VB is considered to be relatively easy to learn and use.[1]

Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.[2]

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.

The final release was version 6 in 1998. Microsoft's extended support ended in March 2008 and the designated successor was Visual Basic .NET (now known simply as Visual Basic).

code example:
Code: [Select]
    Public Function myConvertRadianDegree(ByVal RadianAngle As Double) As Double
        Return RadianAngle * 180.0# / Math.PI
    End Function

source: Visual Basic. (2010, November 18). In Wikipedia, The Free Encyclopedia. Retrieved 12:25, November 19, 2010, from

target audience:{beginner}

F# language / What is F#
« on: November 19, 2010, 01:23:39 PM »
F# (pronounced F Sharp) is a multi-paradigm programming language, targeting the .NET Framework, that encompasses functional programming as well as imperative and object-oriented programming disciplines. It is a variant of ML and is largely compatible with the OCaml implementation. F# was initially developed by Don Syme at Microsoft Research but is now being developed at Microsoft Developer Division and is being distributed as a fully supported language in the .NET Framework and Visual Studio as part of Visual Studio 2010.

Code example:
Code: [Select]
(* print a list of numbers recursively *)
let rec printList lst =
    match lst with
    | [] -> ()
    | h :: t ->
        printf "%d\n" h
        printList t

source: F Sharp (programming language). (2010, November 16). In Wikipedia, The Free Encyclopedia. Retrieved 12:23, November 19, 2010, from

For more information, see Microsoft F# developer centre.

C# language / What is C#
« on: November 19, 2010, 01:21:34 PM »
C# (pronounced "see sharp")[6] is a multi-paradigm programming language encompassing imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft within the .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the programming languages designed for the Common Language Infrastructure.

C# is intended to be a simple, modern, general-purpose, object-oriented programming language.[7] Its development team is led by Anders Hejlsberg. The most recent version is C# 4.0, which was released on April 12, 2010.

Code example:
Code: [Select]
using System;
class ExampleClass
    static void Main()
        Console.WriteLine("Hello, world!");

source: C Sharp (programming language). (2010, November 18). In Wikipedia, The Free Encyclopedia. Retrieved 12:19, November 19, 2010, from
target audience:{beginner}

Math and Geometry / Find the midpoint between two points
« on: November 19, 2010, 10:40:23 AM »
Code: [Select]
''' <summary>
    '''NAME: myMidPoint
    '''AUTHOR: Patrick EMIN
    '''DESCRIPTION: Finds the midpoint between two points
    '''ARGUMENTS: P1 and P2
    '''DATE: 03/11/2010
    ''' </summary>
    ''' <param name="P1"></param>
    ''' <param name="P2"></param>
    ''' <returns>myLineSegment.MidPoint</returns>
    ''' <remarks>easier to create a line segment because we have the .MidPoint property...</remarks>
    Public Function myMidPoint(ByVal P1 As Point3d, ByVal P2 As Point3d) As Point3d
        Dim myLineSegment As New LineSegment3d(P1, P2)
        Return myLineSegment.MidPoint
    End Function

target audience:{beginner}

Math and Geometry / Converts degree angles to radian and vice-versa
« on: November 19, 2010, 10:15:24 AM »
Code: [Select]

    Function myConvertDegreeRadian(ByVal DegreeAngle As Double) As Double
        Return DegreeAngle / 180.0# * Math.PI
    End Function

    Function myConvertRadianDegree(ByVal RadianAngle As Double) As Double
        Return RadianAngle * 180.0# / Math.PI
    End Function

target audience:{beginner}

.NET newbies / The .NET AutoCAD developper guide
« on: November 17, 2010, 10:50:11 PM »
The .NET AutoCAD developper guide is online


Blocks / Changing the order of attributes in a block
« on: November 17, 2010, 10:48:36 PM »
A Philippe Leefsma program written in C for .NET environnment will show you how to change the order of attributes in a block.

target audience:{intermediate}

.NET newbies / Comparing VBA and VB NET
« on: November 17, 2010, 10:43:47 PM »
A document from AutoCAD 2011 help files comparing VBA and VB NET functions.

.NET newbies / Layer 0 in VB NET
« on: November 17, 2010, 10:41:17 PM »
The layer "0" has its own constant in VB NET, it's "LayerZero", think about using it.
The following code makes Layer 0 current in the current document:

Code: [Select]
doc.Clayer = doc.LayerZero

target audience:{beginner}

Visual Studio environment / Plugins for Visual Studio?
« on: November 17, 2010, 10:36:23 PM »
When I was programming with VBA, I used MZ Tools, do you know of any similar addon for Visual Studio?

target audience:{beginner}

Visual Studio environment / Using projects on a network drive
« on: November 17, 2010, 09:36:35 PM »
It seems not possible to place .NET projects on a server, I get fatal errors when trying (curiously, not always), it seems there is a Security Exception problem. Do you know why this is like that and what could be done to overcome it? Thanks.
target audience:{beginner}

This site / Welcome on the AutoCAD .NET developpers forums
« on: November 17, 2010, 09:07:43 PM »

My name is Patrick EMIN, (twitter @Patriiick), I created this site out of frustration not finding code examples and ressources for VB NET programming in AutoCAD.

Well, actually there are good things on the net, but scattered and on my opinion not down to earth oriented. What a newbie in VB NET like me needs is a set of good, simple examples sorted by categories, this is exactly what the "Net code" boards category on this site intend to be, with your help. (code boards are visible once you register on this site)

Thanks to share your expertise for those of you having passed the newbie step, for the others, please be concise and clear when posting questions.

Please see this topic before posting your first message.

Thanks for participating in this venture. You can follow us on Twitter (@AcadNETwork)...

Pages: 1 ... 4 5 [6]