AutoCAD Visual LISP / AutoLISP :: Change Color And Linetype Of Xref Nested Entity

Aug 22, 2012

I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.

Code below...

x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData)
(if (setq Sel (nentsel "
Select object to change layers color and linetype: "))
(progn

[Code]...

HP Elitebook Workstation
Windows 7

View 6 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Convert Nested Xref To Regular

Nov 7, 2013

Any routine or way to convert a nested xref to a regular xref?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Block Element To Layer 0 Without Changing Color / Linetype

Sep 3, 2013

I have too many blocks with specific layers inside.

develope lisp can change all to layer 0 but keep color and linetype as it is.

I will use this as a part of script to change multiple block.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Xref Layer Color

Aug 14, 2009

I'm looking for a lisp that will change all the layer colors of selected xref by clicking the xref and select color from the color table palette. I have a routine that would change the layer color of a selected entity other than xref.

;;Changes selected object layer to a true color
;;of chose from a dialog
box
(defun c:cvc (/ ent ent_data rgb str objlay)
(setq ent
(entsel)
)

[code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Color On All Nested Xrefs

Nov 21, 2011

I want to set all the layers on all nested xref's to color 8.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Xref Layer With Xref Name?

Jul 31, 2009

Is it possible to run a lisp which can extract all the xref names, make a layer with that name and then change the xref on the layer? I have got a similar routine from earlier posts but it doesn't work if any xrefs inserted in paper space (works fine on model space). could change this routine allowing to change the layer of xref in paper space too.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( )
(setq ss (ssget "x" '((0 . "INSERT"))))

[Code].....

View 8 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 :: Rename Layer And Change Linetype

Jun 24, 2009

I need to do three things in a LISP routine for around 200 drawings. First, I need rename lots of old layer to new standard layer name, like change layer name "CL-RAILWAY-0" to new layer name "CL-0".

Secondly, I need translate some layer to standard layer, like all the things on layer "CL-WATER-160" to layer "CL-0"

Last, change some linetype, like change linetype"CENTER" to "CENTERLINE". I can do all those things by "CHECKSTANDARD" manually, but I really need someway faster and easier.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Auto Change To Layer 0 And Linetype?

Mar 9, 2012

how to write a lisp that when i activate it, it will change all the objects in the drawings to be change to "Layer 0" and all linetypes "Dashed" change to be "hidden"...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Color And Linetype Modified By VPLAYER

Nov 2, 2011

How can I get the color that a layer has assumed in an specific viewport, and the same for an specific Linetype when it changed with an VPLAYER command

I found a function LM:GetOverrideData ( layer / data )  ;; © Lee Mac 2010

but return me the same data if I hask about an specific layer in all vports, and in one of them the layer color is modified.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Force Change Linetype And Layer To Preset Preference?

Mar 7, 2012

Is there any way with a click of a button by using LISP, it will change all the selected object to be changed to a pre-set layer...

Example, after i select a certain entities in a drawing, with LISP, it will change all the object to layer "0"?

Additionally, u also need it to change all selected entities that are in "dashed" linetype to be change to "hidden" linetype..

View 3 Replies View Related

AutoCAD .NET :: Change Entity Color / Linetype

Dec 23, 2008

I am using ACADE 2008 and VB.NET. I have a multitude of drawings that I am doing the same three and four operations on and would like to write VB.NET program to do it. I can get my selections set just fine, but my first problem is figuring out how to change all drawing entities color and linetype to "ByLayer". So far I have not gotten past changing just the color value. I have tried multiple variations on the following line without success:

myAcadEnt.Color = Colors.Color.FromDictionaryName("ByLayer")

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change (Reference Name) Of Attached IMAGE Xref TIFF

Feb 13, 2013

I am trying to write a LISP that does the following:

-Open drawing

-Saveas as NEW drawing based on certain criteria from DCL menu

-Deletes old drawing

-*THEN, if drawing contain attached IMAGE FILE (.tiff in my case)

-Rename image file and repath image file based on the new file name

I have gotten it to do all of this, except I can not figure out how to change the "reference name" of the attached image file (.tiff)

Is this read-only data? I can manualy change it under xref manager, so there should be a way to do it via code...

The closest I have gotten:

;;after renaming and repath image file...

(SETQ NAME2 (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)))
(setq item (vlax-ename->vla-object (entlast)));convert to vl object
 (setq check (vlax-property-available-p item "Name" T));check if the entity can be updated
  ;if it can
  (if check
   ;change value to match
   (vlax-put-property item 'Name NAME2))

'Name seems to be valid w/ xref'd blocks but not xref'd/attached image files..

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get Name Of Nested Block

Nov 27, 2013

I need to pick a nested block in drawing, I prepared this code to get name of selected blocks:

 (defun c:test ( / e obj blkName)(while T (while (Not (setq e (entsel "
Select a BLOCK to edit: ")))) (setq obj (vlax-ename->vla-object (car e))) (if (= (vlax-get-property obj 'ObjectName) "AcDbBlockReference") (setq blkName (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename)'effectivename 'name)) );setq );if (princ (strcat "
Block Name is: " BlkName)));while);defun

 But, how to select a nested block?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Lines In Color Yellow To Color 8?

Aug 7, 2006

i am looking for a lisp routine which can change all lines in color yellow ( in different layers) to color 8.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Xref Reactor Object ID To Xref Name

Oct 2, 2012

I am using (trying to anyway) a :VLR-xrefSubcommandReloadItem reactor.  My only question is how to get the xref/block name from the 'reactor callback data' Object ID.

I am ultimately trying to pass it to (vla-get-xrefdatabase ....), but I cannot figure out how to turn the second parameter from the reactor callback data into something I can use - for example the second parameter returned may be "65" or some other number. 

Civil 3D 2011
Windows 7 x64

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nested Blocks In XREFS

Apr 21, 2008

I have an XREF that contain block inserts sometimes nested 2 or 3 levels deep. Given the block names, is it possible to find and translate the insertion point of the nested inserts to the current World UCS?

Ideally I would give a routine the block name and it would scan the current drawing and return a list of the translated insertionpoints>

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Replace Nested Block

Aug 7, 2012

I have a dynamic block that has a nested temporary block inside it. What I am wanting to do is replace the temporary block with the permanent block. I have tried several different variation of coding but I cannot seem to get this bad boy to work. have used:

(vla-put-name (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) "tempBlockName") "newBlockName")

this gives me a duplicate names error. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Determine Existence Of Entity

Oct 10, 2013

I have a specific need to determine if an entity is existing or not so that I can either make changes to or create the entity. I'm trying to do this while referring to the entity by it's handle. Below is my code this far but it doesn't work.
 
(IF (AND (SETQ HNDL (VLAX-LDATA-GET "TB" (STRCAT PLN "PLAN"))) (NOT (VLAX-ERASED-P (VLAX-ENAME->VLA-OBJECT (HANDENT HNDL)))) ) (PROGN ;;| DO SOMETHING WITH THE EXISTING ENTITY ) (PROGN ;;| MAKE THE ENTITY
(vlax-ldata-put "TB" (strcat PLN "PLAN") (CDR (ASSOC 5 (entget (entlast))))) ))

I ran the program and the handle was stored, then I deleted the entity and ran the code again and this is the error I get:

; error: unable to get ObjectID: nil

This VLISP stuff sometime has unpredictable hoops to jump through first, so I wondering if this is the case here.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Text Entity In 3D

Apr 29, 2012

how to draw a text entity in 3d, where I know the 3d ins point, and the plane it should be flat to.

I have not drawn text or inserted blocks programatically before where the plane they lie on is not flat.

I have done it before by setting a ucs and drawing stuff, but now I want no switches of UCS involved.

[URL]

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Xdata From An Entity?

Mar 29, 2012

How can i build a selection set of all circles  and then retrieve the xdata attached to them? 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Snapang Within MVBlocks / ADT Entity

Aug 19, 2013

How do I get the angle of an Mvblock/wall or any other ADT entity to use in a lisp routine to set Snapang?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Access Text In MTEXT Entity

Dec 29, 2012

I am wanting to use autolisp to access the text in a MTEXT entity.  assoc(1) gives me the first bit of text, but not the rest.Is there a way to use assoc to access each of a number of matches or do I need to write my own routine to find all the 1's?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Position XYZ And Rotation XYZ Of Each Entity?

Jul 13, 2011

finding each objects Position XYZ and Rotation XYZ using LISP.  It looks like position is a pretty easy one but rotation data is a bit elusive.  

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Point On Entity But Ignore Ones At 0.0 Elevation

Sep 15, 2011

I need to let the user pick on an entity to get an elevation.

I was using getpoint, with osmode set to nearest, but it allows them to pick 2d items under the 3d items I want picked.

Without doing fancy laer manipulation to turn off 2d stuff, are there any tricks to avoid snapping on the 2d item?

I am thinking I might do an entselp, then try again at same point until i get a 3d one (non 0.0 z coord).

[URL]

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Point Entity In A Hatch Pattern

Nov 29, 2012

Is it possible to include a point entity (rather than a zero-length line as in the standard SQDOTS pattern) in a custom hatch pattern?

If so what's the exact format of the line in the .pat file that defines the point?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Retrieve Length Value Of Single Entity

Feb 27, 2012

When we launch the list command, the Area system variable holds the area value of the selected shape.

How to get the length value into an Autolisp program to use it?

View 3 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 :: Nested Drop Down List In A Ribbon Panels?

Feb 22, 2012

how to create a nested drop down list in a ribbon panel.

is it even possible. It must be, but I don’t know how Autodesk managed to do it in the C3D.cuix for the create ground data panel, point drop down.

second question, where is the icon for a drop down list saved.

looking at a C3D dropdown list icon there is no path to the icon, but when I create one it shows a path.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible To Retrieve Names Of All Nested External References

Sep 20, 2011

is it possible to retrieve the names of all the nested external references, and how should it be done?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove All Attributes Including In Nested Blocks?

Jan 8, 2013

There is a quick way to remove all attributes, including in nested blocks. Looking some lisp in the forum, I can't find one code for remove this elements completely.

View 9 Replies View Related







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