pipefitter72 Posted October 25, 2014 Share Posted October 25, 2014 We have been manually placing control points at the midpoint of pipe fittings. The "point" is actually a small CADMEP object.We do this to export to a robotic station for marking locations in field. I have been trying to modify a lisp I found to automate placing the "points". What I would like to do is place a point in drawing and copy it to midpoint of all selected fittings. I am just not grasping what I need to do the get the midpoints of the fittings and either copy or insert the "point". I have attached the lisp I was attempting to modify. Can someone point me in the right direction? copypastetest.lsp Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted October 25, 2014 Share Posted October 25, 2014 (edited) We have been manually placing control points at the midpoint of pipe fittings. The "point" is actually a small CADMEP object.We do this to export to a robotic station for marking locations in field. I have been trying to modify a lisp I found to automate placing the "points". What I would like to do is place a point in drawing and copy it to midpoint of all selected fittings. I am just not grasping what I need to do the get the midpoints of the fittings and either copy or insert the "point".I have attached the lisp I was attempting to modify. Can someone point me in the right direction? hi pipefitter72 welcome to forum i assume your pipe is line object.. (defun c:Test1 (/ *error* ss s p i e cm es) (defun *error* (x) (if cm (setvar 'cmdecho cm) ) ;_ end of if (princ "\n*Cancel*") ) ;_ end of defun (if (and (setq ss (ssget)) [color="gray"];;; (setq ss (osnap (cadr es) "mid")) ;<---- incorrect due ss not consp [/color] (setq s (ssget "_:L")) (setq p (getpoint "\n Specify base point :")) ) ;_ end of and (progn (setq cm (getvar 'cmdecho)) (setvar 'cmdecho 0) (command "_._copybase" "_non" p s "") (repeat (setq i (sslength ss)) (setq e (entget (ssname ss (setq i (1- i))))) [color="gray"];;; (foreach pt e ;;; (if (eq (car pt) 10) ;;; (command "_.pasteclip" (cdr pt)) ;;; ) ;;; )[/color] [color="#696969"];;suggest by hanhphuc (for line only)[/color] [color="red"] (if (eq (cdr (assoc 0 e)) "LINE") ;<--- assume the pipe object is line (command "_.pasteclip" (apply 'mapcar (cons ''((a b) (/ (+ a b) 2.)) (mapcar ''((x) (cdr (assoc x e))) '(10 11))) ) ;_ end of apply ) ;_ end of command ) ;_ end of if[/color] ) ;_ end of repeat (setvar 'cmdecho cm) ) ;_ end of progn ) ;_ end of if ) ;_ end of defun since you know coding, above is simple tweak vanilla (line object only) for advanced you can attemp VL's vlax-curve* almost similar recent thread here Edited October 25, 2014 by hanhphuc comment: ....ss not consp Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 25, 2014 Author Share Posted October 25, 2014 Thanks for looking at this. My fittings are cadmep pipe fittings. I apologize for not being more clear to begin with.Here is a screen shot of what I am trying to accomplish. Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted October 26, 2014 Share Posted October 26, 2014 hi pipefiter72, Is CADMEP object, a block? shape? or customized? The centroid (midpoint) normally is its property insertion point etc.. im not sure MEP is a proxy object? can you attach drawing? (prefer 2007) *maybe others member can help too* Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 26, 2014 Author Share Posted October 26, 2014 if you do not have MEP you will have to install object enablers. http://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/ENU/123112/files/autocad-object-enablers-html.html here is a dropbox link for DWG. https://www.dropbox.com/s/grgauvltisyh2h2/controlpoint.dwg?dl=0 Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted October 27, 2014 Share Posted October 27, 2014 Hi pipefitter72, Thanx, but I Can't open new version. I'm not sure able to help though proxy enabled ? Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 27, 2014 Author Share Posted October 27, 2014 saved back to 07. https://www.dropbox.com/s/703splqt14stc56/controlpoint07.dwg?dl=0 Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted October 27, 2014 Share Posted October 27, 2014 (edited) hi friend, as expected the dwg shows nothing. i set PROXYSHOW =1 also not working too. i'll try to download enabler from your link... [EDIT] but get this can't proceed next meanwhile i hope somebody using MEP could help you too regards Edited October 27, 2014 by hanhphuc Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 27, 2014 Author Share Posted October 27, 2014 thanks for trying. If I get this working i will post it here. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 27, 2014 Share Posted October 27, 2014 A work around if you can touch the object then you can retrieve the properties of the object like insert point, if you know scale and rotation then you can work out as a code example some point on a block. The problem like CIV3d you have to "open" the database to get at object properties. For a start use Dumpit.lsp and pick object this will give some clues. Paste output here. I am sure there are some MEP enquiry examples here. ;;; Dump all methods and properties for selected objects ; ;;;===================================================================; ;;; DumpIt ; ;;;-------------------------------------------------------------------; ;;;===================================================================; (defun C:DumpIt ( / ent) (while (setq ent (entsel)) (vlax-Dump-Object (vlax-Ename->Vla-Object (car ent)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 27, 2014 Author Share Posted October 27, 2014 i will try it in the morning. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 28, 2014 Share Posted October 28, 2014 Can you post a dwg with some samples please name with text in case proxy objects dont appear, also an image. Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 28, 2014 Author Share Posted October 28, 2014 earlier in the thread I posted a screen shot. and I posted 2 links to dropbox. one is for 2014 dwg and other is same dwg in 2007 format. If you do not have MEP you might have to install mep object enablers for your version of autocad from website. http://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/ENU/123112/files/autocad-object-enablers-html.html Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 28, 2014 Author Share Posted October 28, 2014 Dumpit results Select object: ; IMapsComWrap: IMapsComWrap Interface ; Property values: ; Application (RO) = # ; Area = 0.0 ; CustomData = "GPM - KW/Steps - Louver Free Area = 0.0,Motor HP = ,Pump Impeller = ,Equipment Tag (all) = ,Max/Min CFM - CFM = ,Model # = ,Motor Frame = ,PIU Fan CFM - Pump Head = ,Manufacturer = Weldbend,Vert/Horz FD - Voltage/PH = ,Instructions - FD Access Door = ,L?" ; Description = "S40 LR 90 [ 3 ]" ; Document (RO) = # ; Elevation = "CL=10'-8\"" ; EndSize = "BE 3, BE 3, " ; EntityTransparency = "ByLayer" ; Handle (RO) = "1009A" ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = # ; ItemNumber = "4" ; Layer = "MP-JTFR" ; LengthAngle = 90.0 ; Linetype = "BYLAYER" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Notes = "" ; ObjectID (RO) = 42 ; ObjectID32 (RO) = 42 ; ObjectName (RO) = "MapsContainer" ; OwnerID (RO) = 43 ; OwnerID32 (RO) = 43 ; PlotStyleName = "ByLayer" ; Points = "ENDPOINTS: 19670.48,8807.07,1328.00;19665.98,8802.57,1328.00; MIDPOINT: 19665.98,8807.07,1328.00" ; Section = "Level 1" ; ServiceName = "JTFR Anvil2Thrd150MIxS40" ; Status = " 0: Design" Select object: ; TrueColor = # ; Visible = -1 ; Weight = 4.8 Command: Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 29, 2014 Share Posted October 29, 2014 The dump gives some clues "Points" is handy draw a line using the co-ords and see where it fits make sure snap is off, scale same object by 2 times see if the line length is twice . Compare two objects rotated 90 degs and see if "lengthangle" changes. If you think of the object as a block then its possible to work out the mid pt you need. Do you have a block called JTFR Anvil2Thrd150MIxS40 ? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted October 29, 2014 Share Posted October 29, 2014 Dumpit results Select object: ; IMapsComWrap: IMapsComWrap Interface ; Property values: ... ... ; Points = "ENDPOINTS: 19670.48,8807.07,1328.00;19665.98,8802.57,1328.00; MIDPOINT: 19665.98,8807.07,1328.00" ... ... ... Thank you BIGAL, though i can't help in this thread ,just curious if we can handle proxy object it could be useful as shown the points type is 'STR, maybe "...MIDPOINT:19665.98,8807.07,1328.00" is the key? Quote Link to comment Share on other sites More sharing options...
hertz hound Posted October 29, 2014 Share Posted October 29, 2014 Just curious if you have tried the Autodesk point layout software? http://knowledge.autodesk.com/support/autocad/learn-explore/caas/blog/beyonddesign.typepad.com/posts/2014/06/point-layout-2015-is-here.html I have no idea how much it cost, but they do have a trial version. We are still tape measure and string, so dimensions are all I use. I see the other trades all using the total station on the last few jobs. Quote Link to comment Share on other sites More sharing options...
pipefitter72 Posted October 30, 2014 Author Share Posted October 30, 2014 They have been looking at the points software, we shall see, Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 31, 2014 Share Posted October 31, 2014 Pipefitter72 went to download enabler but its 200+mb so gave up for moment if you can get some object dumps then their may be some patterns appearing and code can be written blind. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.