AutoCAD Visual LISP / AutoLISP :: Change Arrow Size In Mechanical?

Feb 21, 2013

I want to change the arrow size in AutoCAD mechanical using Visual Lisp. (No other language is allowed by the company).

I have the code in VBA but I have not been able to generate equivalent Vlisp code.

The code fails at the following line saying "; error: Automation Error. Problem in loading application".

Importing the library does not make any difference (but I think it is not necessary).

(vl-load-com)
(setq symBB (vlax-invoke-method (vlax-get-acad-object) 'getInterfaceObject "SymBBAuto.McadSymbolBBMgr")))

From there, I have to get the BomMgr and so on. But I am unable to take the first step itself.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Mleader Style - Arrow Head Size Setting

Nov 17, 2009

I have some working code that sets the Text Style name to ROMANS inside my Mleader Style called ARROW. Here it is:

(setq dict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE") ; start setq q
dict1 (member (cons 3 "Arrow") dict) ; code 3 is Mleader Style Description
el1 (entget (cdr (assoc 350 dict1))) ; code 350 is dictionary entity handle
er (tblobjname "style" "Romans") ; new value for MLEADER Text Style
) ; end set
(entmod (subst (cons 342 er) (assoc 342 el1) el1)) ; code 342 is MmTextStyleId - write new vale to mTextStyleId

I want to modify this code so that it sets the Arrow Head Size to a specific value, say 0.125. Having a tough time figuring out the DXF codes and tblobjname to do this.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating (arrow) Block With Two Points For Positioning And Orientation

Jul 13, 2013

I'm trying to create a model of arrow with which I could place in drawing in any length and orientation I want with lisp. I was imaging to place two point on this arrow and by placing the two points on my drawing, the length and orientation of the arrow would be define.

I'm trying for hours to create it and my grip for polar stretching don't stay still on my arrow (suppose to be on the peak but go far if I stretch it).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Have Arrow Leader Convert To Loop Leader In One Click

Jun 1, 2006

Is there a way to have the Arrow leader convert to Loop leader in one click. Our company standards use diamond tags and sometimes i have to change the arrow to loop by inserting a leader.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Set Dim Break Size

Mar 16, 2007

How to set the dimbreak size for their dimstyles (I'm sure it can be tweaked a bit... but works ok as is):

(defun SetDimBreak (DimstyleName Value / ds edata xdata newxdata i ent)
(if
(and
(tblsearch "dimstyle" DimstyleName)
(setq ds
(vlax-vla-object->ename
(vla-item (vla-get-dimstyles
(vla-get-activedocument (vlax-get-acad-object))

[Code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Set Dimension Break Size

May 17, 2013

I there any way to set the dimension break size in autolisp ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimstyle Break Size Variable?

Aug 28, 2009

I want to set the break size in all of my dimstyles but I can't find a system variable for it. know what it is or how else to set it?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reducing Huge Drawing Size

Dec 12, 2005

I had a drawing of 64 MB size.Eliminating the single element and no element groups and optimising the block design we could reduce the drawing to 48 MB size.The drawing does not have layer filters, states and is purged completely. It contains links to an external database in which the attribute data is stored.

What else could be done to reduce the drawing size. The drawing response time is too slow as of now.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Increase Size Of Fixed Dialog Box

Oct 28, 2011

I need to increase the size of a fixed dialog box so I do not have to use the horizontal and vertical scroll bars to see the contents, I have included a picture.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Z Value Only On 3D Polyline

Aug 23, 2012

I am using acad 2010. I have a contour generator that uses 3d polylines to make contours. I get depressions or tops where I don't want them. I need a lisp routine that will allow me to adjust the z value only on any 3d polyline. I need to raise or lower the z value at any vertex and repeat if necessary. I don't need to prompt the user- I am the user.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change VP Linetype

Nov 8, 2012

In our Structural department, we use a layer called S-35-WALL-LB to denote a load-bearing wall, and what the guys typically do when they are on the sheet showing the floor above, is dbl-clk the VP to activate model space, open the Layer Manager and change the VP linetype to HIDDEN to show the afore-mentioned loadbearing walls as walls under.

way to accomplish this through a viewport...but instead of using the Layer Manager, use a lisp routine I can link to a toolbar button where all the user has to do is dbl-clk the VP, press the toolbar button, and either it will convert the default VP linetype (continuous) for S-35-WALL-LB automatically, or get the user to select an object on that layer and it changes the whole lot?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Object Reactor Owner Size Limitation?

Dec 28, 2011

Does Object Reactor has an owner size limitation?

when the owner size is big (about 1000) trying to disable the reactor (vlr-remove ReactorObj) causes AutoCAD to crash right on spot.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sort List Of Lists By Size Of Units?

May 2, 2013

I am trying to sort a list of lists by the size of units.

Here is the unsorted list -

(setq List_Blocks
  (list
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "5x5" "UNIT DOWN-CC" 34)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x30" "UNIT EXTERIOR" 13)
    (list "10x25" "UNIT EXTERIOR" 2)
  )
)

I would like the list sorted by the first number before the "X" and then by the second number after the "X".

Example of sorted list -

    (list "5x5" "UNIT DOWN-CC" 34)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x25" "UNIT EXTERIOR" 2)
    (list "10x30" "UNIT EXTERIOR" 13)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Display Paper Size Of A Layout In Block

Dec 20, 2011

I'm trying to display the papersize of a layout in a block. So far I've looked into diesel and field expressions.

With field expressions I can get the name of the papersize to display that's too long(OVERSIZE: ISO A1), I need only the last two letters.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Annotation Scale To 1:2

Apr 26, 2013

take a look at the test.dwg it contains a block named 'box' (which is a rectangle) and some attributes. the annotation scale is 1:1 and i zoomed in to focus on one attribute.

change the annotation scale to 1:2 and you will see the attribute grows by 2 - that's ok! now load attmod.lsp and run attmod command and you will see the attribute grows again by 2

even the command only (entmod) the attributes without making any change.(to restore it use battman sync)Is there a workaround to this bug?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Colour Change

May 1, 2006

Looking for starting point to writing a routine that will open blocks in a drawing and change the colour.We receive drawings from clients with their blocks and would like to have them changed to our company colours.

So basically, i am looking for something that would within a drawing, change every block to a specific color without exploding and redefining. The colour changes will be the same throughout new drawings.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Attribute Text

Jun 24, 2012

I have a block "MANAGER" with Two Attributes "CETOP" and "CEBOT" I would like a lisp to replace what ever is in those attributes with defined text, for my purposes "Text1" and "Text2". I would like a simple routine that even I can understand so I can apply it to a couple of other lisp projects I have.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Hatch To Particular Layer

Nov 7, 2013

Lisp that can select all hatch in a drawing with a layer called AELE, even if it is embedded in a block and change it to layer AHAT with Green colour?

The layer AHAT may or may not already exist in the drawing.

We need to run the lisp on a lot of drawings (exported from Revit) so I need to use the script to run this lisp on multiple drawings.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Sum Area Calculation Mm2 Into M2

Jan 6, 2012

i've got a lisp-routine that calulates multiple area's and put the sum in text in the drawing on the place i select.

the sum has to be devided with 1000000 so that it is in m2.
 
the lisp-routie i use is:

(defun c:ca(/ pt ent txthgt)
;;; bepalen van de teksthoogte indien current style height = 0
(setq txthgt (cdr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE")))))

[Code]......

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Text Style

Dec 16, 2013

I am trying to put together a LISP that changes the font of two text styles. One bing  named "Standard", and the other "WD".

This is what I have so far...

(defun C:CHANGESTYLE (/ entities len count ent ent_data ent_name new_style_name)
(command "STYLE" "Standard" "Romantic" "" "" "" "" "")
(setq entities (ssget "X" '((0 . "TEXT")))
len(sslength entities) count 0);

[Code]....

 I couldn't figure out how to select mtext and text all in one swoop, so i ran it twice 

Now, when i run this code, i get the following error "lselsetp nil".

CADMASTER TECHNOLOGIES, LLC
[URL]....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer

Jul 25, 2006

I have been filtering through this descuession group for a whil this morning looking for what I need and have found somethings that are close but haven't managed to change them a little to do what I am wanting..

I have drawings with a block named UG101 and has been inserted on all sort of different layers.

What I would like to do is run a lisp routine that would select all blocks with the name UG101 and put them on the layer CableInfo.

I have many other blocks that i need to do the same to but with different names, so I was hoping, I could change the lisp routine around to do the rest of the blocks in the drawing..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Attribute Width

Jan 9, 2013

I found this routine [URL]...... that changes the width of an attribute in a block. After use it, I need to use the ATTSYNC to update the other instances of the bloc in my project.

How to modify this lisp that I receive a prompt to choose if the width attribute will be change just in the selected block or in all instances of the block? In that way, I would not have to use the ATTSYNC command each time.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Change Radius Value In Duct

May 17, 2013

This is a duct lisp which is i found , which code line i have to change and how for radius value ? for example if my .

" Specify first segment width value " is 1500 then i wanna be my inside fillet radius 1500 / 3 ---------------------------------------------------------------------------------------------------------------------------------------- (defun c:duct(/ actDoc Ang1 Ang2 ptLst enDist fPt lEnt lObj lPln oldVars oldWd plEnd plStart1 plStart2 prDir segLst Start stDist stLst tAng vlaPln *error*) (vl-load-com) (defun GetPlineVer(plObj) (mapcar 'cdr (vl-remove-if-not '(lambda(x)(=(car x)10)) (entget plObj))) ); end of GetPLineVer (defun asmi-PlineSegmentDataList(plObj / cLst outLst) (setq cLst (vl-remove-if-not '(lambda(x)(member(car x) '(10 40 41 42))) (entget plObj)) outLst '() ); end setq (while cLst (if(assoc 40 cLst) (progn (setq outLst (append outLst (list (list (cdr(assoc 10 cLst)) (cdr(assoc 40 cLst))
[code]............

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Programmatically Change Labels In DCL

Jun 24, 2013

I am working with an application (written in Delphi) that interfaces to AutoCAD via AutoLisp and automation. The app is localized using translation strings that are stored in a database. We are working on translating the menus and dialogs on the AutoCAD side. The menus are no problem as it is easy to change the Label property of the menu items in code on the fly. However I haven't been able to find anything similar for the dialogs. Other then rewriting the DCL file on-the-fly is there any way to programmatically change the labels on the dialogs?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Color In Ribbon

Jul 2, 2012

In our 2010 version users used the "OPT Color Control" in a toolbar. When we went to 2012 we switched our users to the Ribbon. I am not able to move this Control to a ribbon panel. I can place in a toolbar and it works okay. Best I could find is "ACObjectColorCombo", Object Color Gallery drop down. Unfortunately I find that this drop down doesn't handle a selection set the way the 2010 toolbar did. I find that one cannot reliably pick a selection and use this to change objects to color bylayer. I can pick the object prior to using the OPT Color Control and they work fine. I pick the same objects and use the Combo box and sometime they are found and change other times I pick one or two and they work.

Is there a way to move this toolbar control to the ribbon, it will not let me drag and drop to a panel in the CUI.

Is there another solution to change object(s) color in a drop down from a ribbon panel? I have tried searching but am not finding other commands or control with selection drop down in the CUI. (Our choice is not to use the Properties dialog. Which, by the way, does work every time on the objects.)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Change Plot Style

Feb 21, 2001

Is there a way for me to change a layers plot style from one to another with LISP?

We use named plot styles, STB's not CTB's.

I want to be able to create an icon that will change all layers with the plotstyle "normal" to "black". Is this possible with lisp?

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multi Change Layer

Feb 6, 2012

I have the following Lisp command that changes a selected layer to a different layer. I have tried modifying it change known layer names to different known layer names. i.e run routine and it changes layer "2" to "3" then changes layer "dim" to "dims" ect then stops.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open / Change And Plot DWG

Jul 9, 2013

Is it possible to open a dwg, change something and then plot a layout with visual lisp. This is my start. Opening is working, but plotting not. I have to switch between drawings before the function is going on. Sometimes it's plotting an empty sheet and otherwise an error: ERROR: Automation Error. Description was not provided.

(defun plotbatch ()(vl-load-com)(setvar "sdi" 0);; open file(setq acadobject (vlax-get-acad-object))(setq documents (vla-get-documents acadobject))(setq open (vla-open documents "U:\testfile.dwg" :vlax-false));; changing something;; plot layout(setq plot (vla-get-plot open))(vla-put-NumberOfCopies plot 1)(setq layouts (vla-get-layouts open))(vlax-for each layouts (if (= (setq name (vla-get-name each)) "TestLayout") (progn (setq salayout (vlax-make-safearray vlax-vbString (cons 0 0))) (vlax-safearray-put-element salayout 0 name) (vla-setlayoutstoplot plot salayout) (setq errmsg (vl-catch-all-apply 'vla-PlotToDevice (list plot "\\RW-PRN01\RICOH"))) (if (vl-catch-all-error-p errmsg) (prompt (strcat "ERROR: " (vl-catch-all-error-message errmsg))) ) ) ));; close file(vla-close open :vlax-false)(princ))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Precision For Some Calculation?

Mar 25, 2013

I prepared a lisp code that needs high precision calculation:
 
(defun Time2Frac ( h m s hsec)(+ (/ h 24.0) (/ m 1440.0) (/ s 86400.0) (/ hsec 8640000.0)))
 
test:

(Time2Frac 23 59 59 99)

it returns 1.0 but the real result is 0.9999998842592

so, how can I change the precision of AutoCAD for some calculation?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove Hidden Data And Reduce File Size

Mar 27, 2013

I am trying to reduce the drawing file size.  This is for uploading the drawings to AutoCAD WS.  AutoCAD WS doesn't display or edit a drawing that is over 15MB. Unfortunately some of our drawings are over 15MB even after I have removed the background and others and have purged. I believe the reason why a drawing can be so big has to do with each object (grouped object) has a ton of information on it. For example, the properties of a typical object is like this:

( (-1 . <Entity name: 7ffffbece60>) (0 . "PRCD_FITTING") (5 . "145B6") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7ffffbece70>) (102 . "}") (330 . <Entity name: 7ffffbf59f0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "CPrcdEntity") (280 . 10) (90 . 601861454) (70 . 24058) (70 . 4567) (280 . -65) . . Skip 3000 lines here for clarity . (90 . 0) (90 . 0) (90 . 0))

You can see from above that the list of properties are huge.  All I really need are the visible parts of the object.  This means most of the info above are junk.I try to reduce the size of object by exploding all the objects on the drawing.  This sort of work in the sense that the file size of a test drawing is reduced from something like 8MB down to 6MB.  But I am expecting far more reduction than this.  The reason why I expect far more reduction is that the total number of lines of the exploded items of the same object mentioned above is reduced from 3000+ lines to only 300 lines as shown below:
 
( (-1 . <Entity name: 7fffe8654f0>) (0 . "LINE") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B11F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "AcDbLine") (10 4188.87 -423.095 156.0) (11 4188.87 -387.095 156.0) (210 0.0 0.0 1.0))( (-1 . <Entity name: 7fffe8655f0>) (0 . "LINE") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B12F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "AcDbLine") (10 4248.87 -453.095 156.0) (11 4212.87 -453.095 156.0) (210 0.0 0.0 1.0)).. Skip 250 lines here for clarity.( (-1 . <Entity name: 7fffe865260>) (0 . "MTEXT") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B0F6") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT-ANNO") (62 . 1) (100 . "AcDbMText") (10 4193.39 -418.589 150.0) (40 . 3.0) (41 . 19.8) (46 . 0.0) (71 . 1) (72 . 1) (1 . "\Fdim.shx;\W0.7000000000;\T1.0000000000;\o\l24X30THRT") (7 . "BonDuctTXT") (210 0.0 0.0 1.0) (11 1.0 1.46161e-017 0.0) (42 . 17.5) (43 . 3.0) (50 . 1.46161e-017) (73 . 1) (44 . 1.0))

Therefore, I am expecting a 10-to-1 reduction, not just a 1/4 reduction.I am wondering there may be hidden data on the drawing that are left behind after I have exploded the objects. if there is a way to get rid of the hidden data?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Color Of Drafting Tool Tip

Aug 24, 2012

I use the following lisp to control my window background colour,

;Setting window colour to crimson (uses OLE colour code system)...(vla-put-TextWinBackgrndColor(vla-get-display(vla-get-preferences(vlax-get-acad-object)))3937500)

However I would like to change the drafting tool tip background also using lisp, but I don’t know which vla-put-….. I need?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved