01-20-2010 11:18 AM
01-21-2010 01:34 AM
Hi,
I'm not sure what you want. If you want to program objects from labview, you need to have autocad installed to access it through activex.
maybe this will help (is in lv 8.6)
cosmin
controlsag
01-21-2010 06:12 AM
Hello All,
You've been of great help. Thanks Cosmin, you are right. I actually meant 'controlling Autocad from Labview'. This is an example for one object, but
1. can i do this for multiple objects in autocad and how?
2. Also, what of if i move the object directly from autocad, how do i get an indicator in Labview reflecting this movement?
Thanks alot,
demmy
01-21-2010 08:58 AM
demmy wrote:Hello All,
You've been of great help. Thanks Cosmin, you are right. I actually meant 'controlling Autocad from Labview'. This is an example for one object, but
1. can i do this for multiple objects in autocad and how?
2. Also, what of if i move the object directly from autocad, how do i get an indicator in Labview reflecting this movement?
Thanks alot,
demmy
This is where you'll have to earn your pay as a programmer.
If you need to do this for multiple objects, then you'll need a loop.
If you need to work with existing objects, there appears to a method in the AcadModelSpace reference called Item. It returns the reference to an object based on an index number you enter. Then you can use methods and read and modify properties on the object that is returned. It won't be easy because you'll have to figure out a way to determine in LabVIEW which object in AutoCAD you are actually working with. It might be iterating through all the Items until you find the one that matches particular properties.
If you want to monitor any changes to an object such a move, you'll probably have to read the properties of that Item in a loop and determine when they have changed from one iteration of the loop to the next.
None of this will be easy. I have some big doubts that you will be able to accomplish this successfully. I don't want to discourage you, just let you realize what you want to do is a very ambitious project.
I think it might be a bit easier to do most of the heavy work in AutoCAD's programming language. It used to be LISP. I think they now have put in some visual basic-like programming language. You could then set up a communication protocol between the AutoCAD program and your LabVIEW program to pass commands and data back and forth. Perhaps using TCP/IP ports between the two applications.
01-21-2010 09:56 AM
01-21-2010 10:20 AM
01-22-2010 04:04 AM
Hi,
with some discipline and good framework you can create an application that read a drawing and modifies it in labview. Detecting the object is possible,
through exposed properties by autocad, like object name. It's quite some work. If you want to do such an application read carefully the autocad help regarding activex and autocad object models.
cosmin
01-25-2010 07:12 PM
Hello Cosmin,
I have been trying to run the code you gave me but it keeps returning the error " Error -2147221164 occurred at Class not registered". I don't know what it means. Pls, help out.
demmy
01-25-2010 07:20 PM
Demmy,
Not sure that it matters, and I suppose it is none of my biz, but why are you trying to use Labview to do this? If you think the Labview graphical programming language will make this task easier, I don't think it will. If I were you, I would try to write the program using visualLISP, which is included with AutoCAD, and is well documented within AutoCAD's installed help. There are plenty of tutorials as well. It won't happen overnight, but if you work through a few examples, I think you'll figure it out.
My two cents.
-Mike
01-25-2010 07:42 PM
Well, Thank you for your input. I am actually tagging (using Wifi Tags) building components and collecting the status information in a database. The status information is coordinates (in terms of movement). I now want this movement to be reflected in the virtual tagged component in Autocad. For example, if i tag a wall and i move the wall in the physical, i want to be able to see it move in the virtual model. Also if i move the wall in the virtual model, i want to be able to get the coordinates data outside the virtual model.
I have done the first part in labview, thats why i thought the others will be easier in labview. I am only going to be dealing with 10 objects or components.
demmy