Search the Community
Showing results for tags 'object'.
-
I had this awesome code from Lee Mac about aligning a block to an object and wanted to know if it can be updated to also allow for the block to maintain the location and just align from the original location. This is helpful for aligning survey block to the orientation of the road line object. The code is attached to this post. LM_BlockAlign.lsp
-
Text size and Object Problem in Base ( from Model Space)
S43MG posted a topic in AutoCAD 3D Modelling & Rendering
So recently we got few assignments and we were given the given the video on how to like make 3D object and select it and a new page called layout is formed where all the views like top, front, side and isometric view can be displayed for the selected object. I have already set the Units and limits which is in mm and 297 x 210 mm and text size to 5, but when I am adding text in the layout which is in inches I believe its way too big ofcourse but the same thing when my Sir/Professor did there wasn't a problem but it could be that the page layout was already set in mm which I did later and the text size problem was fixed but now the problem was that the dotted lines suppose for a cube the one which supposed to be on other side are like really small and when I convert it to pdf form I am not able to see it which wasn't the case when my Sir did it and also I did not have the page border which I was having when the page layout was in inches. So if anyone knows how I can fix/set the layout settings/options correctly for the page layout/Base please let me know, it would be great if I can get reply quickly cause I have to complete these assignments as soon as possible. -
this is probably super simple but can't find the answer: (setq apr (vlax-ename->vla-object (entlast)));#<VLA-OBJECT IAcadRegion 000002c2d9920cb8> (vla-put-Normal apr '(0.0 0.0 1.0)); error: ActiveX Server returned an error: Type mismatch (vla-Update apr)
-
All, I've been using Lee Mac's "Add object to block" lisp for sometime now and it works great, and one of the things I use it for is my title block for revisions but now the revision block has been inserted into the title block as a block and it won't add what I want to the revision block. Is there a way to make it find the revision block inside of the title block? Basically I would to able to pick the block inside of a block. ;;----------------=={ Add Objects to Block }==----------------;; ;; ;; ;; Adds all objects in the provided SelectionSet to the ;; ;; definition of the specified block. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; doc - Document Object in which block resides. ;; ;; block - Entity name of reference insert ;; ;; ss - SelectionSet of objects to add to definition ;; ;;------------------------------------------------------------;; (defun LM:AddObjectstoBlock ( doc block ss / lst mat ) (setq lst (LM:ss->vla ss) mat (LM:Ref->Def block) mat (vlax-tmatrix (append (mapcar 'append (car mat) (mapcar 'list (cadr mat))) '((0. 0. 0. 1.)))) ) (foreach obj lst (vla-transformby obj mat)) (vla-CopyObjects doc (LM:SafearrayVariant vlax-vbobject lst) (vla-item (vla-get-Blocks doc) (cdr (assoc 2 (entget block)))) ) (foreach obj lst (vla-delete obj)) (vla-regen doc acAllViewports) ) ;;-----------------=={ Remove From Block }==------------------;; ;; ;; ;; Removes an Entity from a Block Definition ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; ent - Entity name of Object to Delete from Block [ENAME] ;; ;;------------------------------------------------------------;; (defun LM:RemovefromBlock ( doc ent ) (vla-delete (vlax-ename->vla-object ent)) (vla-regen doc acAllViewports) (princ) ) ;;------------------=={ Safearray Variant }==-----------------;; ;; ;; ;; Creates a populated Safearray Variant of a specified ;; ;; data type ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; datatype - variant type enum (eg vlax-vbDouble) ;; ;; data - list of static type data ;; ;;------------------------------------------------------------;; ;; Returns: VLA Variant Object of type specified ;; ;;------------------------------------------------------------;; (defun LM:SafearrayVariant ( datatype data ) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray datatype (cons 0 (1- (length data)))) data ) ) ) ;;------------=={ SelectionSet -> VLA Objects }==-------------;; ;; ;; ;; Converts a SelectionSet to a list of VLA Objects ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; ss - Valid SelectionSet (Pickset) ;; ;;------------------------------------------------------------;; ;; Returns: List of VLA Objects, else nil ;; ;;------------------------------------------------------------;; (defun LM:ss->vla ( ss / i l ) (if ss (repeat (setq i (sslength ss)) (setq l (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) l)) ) ) ) ;;---------------=={ Block Ref -> Block Def }==---------------;; ;; ;; ;; Returns the Transformation Matrix and Translation Vector ;; ;; for transforming Block Reference Geometry to the Block ;; ;; Definiton. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; e - Block Reference Entity ;; ;;------------------------------------------------------------;; ;; Returns: List of 3x3 Transformation Matrix, Vector ;; ;;------------------------------------------------------------;; (defun LM:Ref->Def ( e / _dxf a l n ) (defun _dxf ( x l ) (cdr (assoc x l))) (setq l (entget e) a (- (_dxf 50 l)) n (_dxf 210 l)) ( (lambda ( m ) (list m (mapcar '- (_dxf 10 (tblsearch "BLOCK" (_dxf 2 l))) (mxv m (trans (_dxf 10 l) n 0) ) ) ) ) (mxm (list (list (/ 1. (_dxf 41 l)) 0. 0.) (list 0. (/ 1. (_dxf 42 l)) 0.) (list 0. 0. (/ 1. (_dxf 43 l))) ) (mxm (list (list (cos a) (sin (- a)) 0.) (list (sin a) (cos a) 0.) (list 0. 0. 1.) ) (mapcar '(lambda ( e ) (trans e n 0 t)) '( (1. 0. 0.) (0. 1. 0.) (0. 0. 1.) ) ) ) ) ) ) ;; Matrix x Vector - Vladimir Nesterovsky (defun mxv ( m v ) (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m) ) ;; Matrix x Matrix - Vladimir Nesterovsky (defun mxm ( m q ) (mapcar (function (lambda ( r ) (mxv (trp q) r))) m) ) ;; Matrix Transpose - Doug Wilson (defun trp ( m ) (apply 'mapcar (cons 'list m)) ) ;;---------------------=={ Select if }==----------------------;; ;; ;; ;; Provides continuous selection prompts until either a ;; ;; predicate function is validated or a keyword is supplied. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; msg - prompt string ;; ;; pred - optional predicate function [selection list arg] ;; ;; func - selection function to invoke ;; ;; keyw - optional initget argument list ;; ;;------------------------------------------------------------;; ;; Returns: Entity selection list, keyword, or nil ;; ;;------------------------------------------------------------;; (defun LM:SelectIf ( msg pred func keyw / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (if keyw (apply 'initget keyw)) (setq sel (func msg)) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'STR (type sel)) nil ) ( (vl-consp sel) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) ;-------------------------------------------------------------; ; -- Test Functions -- ; ;-------------------------------------------------------------; (defun c:Add2Block ( / *error* _StartUndo _EndUndo acdoc ss e ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (and (setq ss (ssget "_:L")) (setq e (LM:SelectIf "\nSelect Block to Add Objects to: " '(lambda ( x ) (eq "INSERT" (cdr (assoc 0 (entget (car x)))))) entsel nil ) ) ) (progn (_StartUndo acdoc) (LM:AddObjectstoBlock acdoc (car e) ss) (_EndUndo acdoc) ) ) (princ) ) ;-------------------------------------------------------------; (defun c:Remove ( / *error* _StartUndo _EndUndo acdoc e ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (while (setq e (car (nentsel "\nSelect Object to Remove: "))) (_StartUndo acdoc) (LM:RemovefromBlock acdoc e) (_EndUndo acdoc) ) (princ) ) (vl-load-com) (princ) ;;------------------------------------------------------------;; ;; End of File ;; ;;------------------------------------------------------------;;
-
selecting objects by layer
Jamez posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Is it possible to select objects by layer using only the command prompt, I know it is possible to select objects by other means but I'm specifically trying to use the command prompt to run a script which will go on to cleanse dxf files. If not, does anyone now of a lisp routine which would enable this to work? Can lisps be called in scripts (have never tried)? Trying to select objects (blocks) to scale them to their correct size, now I'm sure their are other ways of doing this too but for some reason these particular blocks are "phantom" for want of a better word. And, cant be edited by double clicking them! The general idea is to cleanse the data as much as possible (set layers, colours etc) with no input from the end users. Hope the above is clear and thanks in advance for any and all help -
Automatically update fields from specific object with one action
matt220992 posted a topic in AutoCAD LT
Hi everyone, I have a quite a specific question relating to auto-filling fields that are inserted into text. To give you some context I work in the lighting design industry and draw 2D lighting layout plans. I am currently trying to build a collection of dynamic blocks which contain attributes relating to their reference letter, circuit number, location, etc etc. This bit I have done quite easily. I plan to use these attributes to export to excel later, again something I already have working. The way our company labels the light fittings on plan is to use a leader. However if I have already given the block the information it requires for it attributes (and excel usefulness) I don't want to spend time typing it all out again in the leader. I have inserted some fields into my leader that recall the information I have stored in the block attributes but it is probably slower to insert them and click through the Field dialogue box than it is to just type in manually! What I want is to be able to have a generic leader with the fields that will refer to any given block (using the same names for those attributes) that when, for example the tip of the leader arrow touches a specific block the fields know that is the object they need information from, that way I don't have to right click each field and re-select the block manually. I just need a way of making this a one action process for each leader instead of having to do it for each field within it. I hope this makes sense to someone, more than happy to try and explain better if not! Many thanks, Matt -
Insert Excel Sheet into CAD File.
tipu_sultane posted a topic in AutoCAD Drawing Management & Output
How to insert the Excel File in CAD file. I am using AutoCAD 2012. I used io command and try to attach file by browse tab, but facing two problems. 1.) The attached file result display not full sheet i.e not all rows and columns that I want to display in CAD file. 2.) It only attaches the first sheet from the file. i.e If I want to attached other sheet from the same file what to do. Thanks. -
Canceling Object Selection / AutoCAD Processing
daczac posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I am working on a drawing with very large polygons with hundreds of verticies. When one of these polygons are selected, either purposely or by accident, it takes a considerable amount of time for the selection process to run its course. I have tried to turn off properties but that didn't help. Ultimately it would be ideal if you could escape out of this selection process if you decided you did not want to wait. Unfortunately the escape key works only after the selection process ends and the verticies are visible. AutoCAD is locked up until the selection process ends. Is there another way to cancel or escape while AutoCAD is processing a selection such as this?- 4 replies
-
- processing
- object
-
(and 3 more)
Tagged with:
-
How to select the similar object in AutoCAD 2010?
tipu_sultane posted a topic in AutoCAD Beginners' Area
I am using the AutoCAD2014 and here I select the similar object by selecting the object and then right click to pop-up menu then click on select similar. But in someone else computer having AutoCAD2010 perform the same task but not found the select similar. If any other method exist then please inform me anyway thanks.- 3 replies
-
- select similar
- object
-
(and 2 more)
Tagged with:
-
Hello. I have a problem to draw the object in the red rectangle below. Should I draw 4 circles inside or how should I draw it?
-
Hiding an object in a viewport on the same layer as others
Liltygar posted a topic in Mechanical & MDT
I am trying to hide a specific object that is a part of other layers. I do not want to hide other layers or have this line hidden in other view ports. Is there something that can be done? i have tried in the view port to hide object, and the object was hidden in my other view ports as well. Isolate object hides all objects in that layer - so that won't work. I have heard this can be done - but don't remember how to do it.- 5 replies
-
- object
- layer control
-
(and 2 more)
Tagged with:
-
How do I permanently attach materials & textures to objects
ajac63 posted a topic in UVW Mapping, Textures & Materials
Hi all, How do you permanently attach or embed materials to an object in 3Ds Max. Thanks if anyone can help. -
Missing properties of objects in Autocad architecture
Basgielen posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I used architecture on my pc. I installed Autocad on another pc with the same Serial code. I can see on the top that my version suddenly is a Educational version. I'm telling you this because i don't know if this is the reason of my problem. The problem: i can't see the properties of an object when i use autocad architecture in the educational version. For example: I make a wall and i place a window in the wall. Now i want to change the width of my window, using the properties bar. SO i click on my window (right mousebutton) and click on PROPERTIES. It opens the properties bar BUT i can't see the window and his properties. At the top of the properties bar it says "No selection".. How can this be when i begin with the right mouseclick on my window?? When i do it in the other direction: Open properties (ctrl+1) first and then select for example my wall, still nothing changes in the properties bar! Can someone please help me??- 4 replies
-
- object
- educational version
-
(and 2 more)
Tagged with:
-
A very general question, I would like to ask how to draw a certain line and be able to delete part of it. Example 1: I would like to draw a bunch of seried resistors, so I made a bunch of rectangles and draw a wire across them. But there are wire crossing through each one of them, how do I remove/erase that part in between each of the resistor? The line is made by using command: LINE Example 2: Drawing some polygon and random shapes. Simplest example, drawing a half circle, so I draw a circle and want to remove the other half, how do I do it? Yes, I know in example 1 I can do one object first then copy paste... But that is not what I am asking. I am seeking the command how to remove the lines or object in between.
-
Applying a Surface/Turning a series of Curves into a Solid Object
gp11g08 posted a topic in AutoCAD 3D Modelling & Rendering
Good Afternoon, I am currently working on a project that involves some basic collision simulation of an LNG ship in Solidworks. However, before I can do that I need to turn the ship (which at the moment exists as a series of curves, see attachment!) into a solid object, which I can then export as an IGES file. So far I have tried the PRESSPULL command on the advice of someone, and it hasnt worked at all, only produced a "not responding message". Can anyone help me apply a surface, or turn the curves into a solid object? Any help would be greatly appreciated by an extremely inexperienced CAD user! Many thanks gp11g08 -
participating in this operation. Newer AEC Objects will be disallowed from participiting in this operation. This dialog pops up when I try to insert blocks from a Tool Palette Is there any way around this....I cannot figure it out...need some help
-
Hello my name is Joseph Marquez and I am kinda new to this, so thank you for helping me. So here is my situation: I created objects and extruded them and then I adding materials from the Autocad 2011 material library. I added brick to a wall and I was wondering what command I would have to type in to "scale" the brick size or just have a way so that the material will appear larger on the object because the bricks are quite small. So that's my problem and I thank you in advance.