- this has nothing to do with activex (or matlab). The problem is with the format of the text that your autocad function expect. At a push, your question is about inserting control characters in a char array.
- In all likelyhood you don't need to use invoke or get. The following code would probably work:
ActiveX: How to post a path?
Hi, I've started using the ActiveX interface to communicate with Autodesk AutoCAD (version 2016). Therefore I use the invoke command. This works pretty fine as it comes to execute basic commands (both create circle (1) & (2)) but I haven't found a solution on how I can post paths along with invoke. I am trying to attach an image to a drawing therefore I call the -ATTACH command. A backspace usually ends an entry as in the following example after the -ATTACH command.
acad=actxGetRunningServer('AutoCAD.Application'); % get the instance of AutoCAD which is running priorly
documents.Add %create a new drawing
c_doc=get(acad,'ActiveDocument'); % current document instance
% both of the following commands do work: invoke(c_doc,'PostCommand','_Circle 2,2,0 4 '); %create circle(1) invoke(c_doc,'PostCommand','_Circle vbCr 2,2,0 vbCr 4 vbCr') %create circle(2)
% However, this command is not posted to ACAD correctly: invoke(c_doc,'PostCommand','-ATTACH C:\users\me\myimage.jpg 0,0 490 0 '); %-ATTACH Path Insertpoint Scale angle
But this doesn´t work after the specified path, all entries are recognized as part of the path, commonly used commands from VBA (vbCr, &vbCr,...) also don´t work or I just haven´t found the right one, yet. Does someone have a solution for this?
Thanks very much!
1 commentaire
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!