.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to launch a LISP routine from VB.net

0 REPLIES 0
Reply
Message 1 of 1
nvanlaar
382 Views, 0 Replies

How to launch a LISP routine from VB.net

I have a VB routine supplied from a friend that sets all layer colors from RGB values to ACI colors. Now I want to set all objects' colors to 'by layer' which I found a LISP routine for. How do I get the VB program to launch the LISP routine or even better is there a way to set objects to color by layer in VB and skip the LISP?



BTW- I know just enough to be dangerous, so sorry if this is elementary stuff. (Following is the current VB code.)



Thank you for any help. (even it is just pointing me to appropriate links)

Nick



'Start------------------------------




On Error GoTo err

'----------find AutoCAD application------------------



Dim poAcad As Object 'Autocad.AcadApplication



Set poAcad = GetObject(, "AutoCAD.Application")



Set poAcad = GetObject(, "AutoCAD.Application")





poAcad.Visible = True



Set acadDoc = poAcad.ActiveDocument



'--------------------------------------------------------------------------



'Scan the AutoCAD layer list and look for standard RGB color values



Dim layerNames As String

Dim layerColors As String



ctr = 0



layerColors = ""



layerNames = ""



For Each entry In acadDoc.layers



Text1.Text = entry.Name 'display current layer name in text box



'Grab RGB Layer color and Convert to AutoCAD 255 Index Colors (ACI)



AColor = acadDoc.layers(entry.Name).Color



Set Layerobj = acadDoc.layers.Add(entry.Name)



Layerobj.Color = AColor







Text1.Refresh 'redraw text box



ctr = ctr + 1 'start counter to count number of layers





Next



Text1.Text = ctr & " Layers Converted"



Beep

GoTo pau



err:

'If err Then 'MsgBox Err.Description

er = MsgBox("Can't find AutoCAD, Please verify that AutoCAD is Open and try again." & vbCrLf & err.Description & ". Error: " & err.Number, vbInformation, "AutoCAD Instance Not Found!")





pau:













'end---------------------------------------------

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost