Recent Posts

Pages: [1] 2 3 ... 10
1
CAD General / Re: "Autodesk vapourises ten per cent of jobs to go completely cloudy"
« Last post by Crank on February 06, 2016, 02:11:38 pm »
TheRegister isn't a very reliable news site. I doubt Autodesks clients are ready for the cloud.

Here is more about this.
Quote
More details on the restructuring will be released when the company announces fourth-quarter results on February 25, Autodesk said.
2
The code in my previous post could process the same block twice.
New code:
Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun _Conv_Pickset_To_EnameList (ss / i ret)
  3.  (if ss
  4.    (repeat (setq i (sslength ss))
  5.      (setq ret (cons (ssname ss (setq i (1- i))) ret))
  6.    )
  7.  )
  8. )
  9.  
  10. (defun c:CombineLayers (/ N_Modify cLyrNme blkLst blks doc i lyrs ss)
  11.  
  12.  (defun N_Modify (obj / blk lyr)
  13.    (setq lyr (vla-item lyrs (vla-get-layer obj)))
  14.    (vla-put-layer obj cLyrNme)
  15.    (if (= 256 (vla-get-color obj))
  16.      (vla-put-color obj (vla-get-color lyr))
  17.    )
  18.    (if (= "BYLAYER" (strcase (vla-get-linetype obj)))
  19.      (vla-put-linetype obj (vla-get-linetype lyr))
  20.    )
  21.    (if (= -1 (vla-get-lineweight obj))
  22.    )
  23.    (if
  24.      (and
  25.        (vlax-property-available-p obj 'hasattributes)
  26.        (= :vlax-true (vla-get-hasattributes obj))
  27.      )
  28.      (foreach att (vlax-invoke obj 'getattributes)
  29.        (N_Modify att)
  30.      )
  31.    )
  32.    (if
  33.      (and
  34.        (= "AcDbBlockReference" (vla-get-objectname obj))
  35.        (not (vl-position (setq blk (vla-item blks (vla-get-name obj))) blkLst))
  36.      )
  37.      (setq blkLst (append blkLst (list blk)))
  38.    )
  39.  )
  40.  
  41.  (if (setq ss (ssget))
  42.    (progn
  43.      (if (= (logand (getvar 'undoctl) 8) 8)
  44.        (vla-endundomark doc)
  45.      )
  46.      (vla-startundomark doc)
  47.      (setq lyrs (vla-get-layers doc))
  48.      (setq blks (vla-get-blocks doc))
  49.      (setq cLyrNme (getvar 'clayer))
  50.      (foreach obj (mapcar 'vlax-ename->vla-object (_Conv_Pickset_To_EnameList ss))
  51.        (N_Modify obj)
  52.      )
  53.      (setq i 0)
  54.      (while (< i (length blkLst))
  55.        (if (= :vlax-false (vla-get-isxref (nth i blkLst)))
  56.          (vlax-for obj (nth i blkLst)
  57.            (N_Modify obj)
  58.          )
  59.        )
  60.        (setq i (1+ i))
  61.      )
  62.      (vla-endundomark doc)
  63.    )
  64.  )
  65.  (princ)
  66. )
4
CAD General / Re: Fields in Title Block
« Last post by nullptr on February 06, 2016, 03:11:24 am »
Late to the party,  I used fields and dwgprops. I used lisp/.net routines to copy/add/remove/swap values between dwgs.
I did a setup at one company, that would import from the bidding program, everything we could think of was imported, material, hardware , etc..

there’s a lot you can do with fields  8-)
5
AutoLISP (Vanilla / Visual) / Re: AutoCAD / Rhino coordination
« Last post by MickD on February 05, 2016, 05:20:15 pm »
So this sounds like if I can write the coordinates of a bock in AutoCAD to an XML file, I can use an interface in SketchUp or Rhino to import those coordinates and swap out that AutoCAD block for a SketchUp component?

Sounds simple in theory, I need to figure out where I can learn how to write XML files.

Yes, you can even hold the modelling data of the 3d object in XML as points, edges, faces and manifolds along with other no graphical attributes.

There are 2 ways to approach this, one would be to create your own XML schema for your files or use a well-known schema such as IFC or LandXML. If you need to store graphical data I'd lean towards the latter and you may be able to find tools to use at both ends of the CAD systems already available (i.e. that can read/write IFC in AutoCAD or Rhino say).
If you are only using placement and non-graphical data from AutoCAD and you have 'blocks' in the other CAD system then a simple XML schema of your own would suffice.
6
CAD General / Re: Fields in Title Block
« Last post by Pukenzz on February 05, 2016, 02:34:32 pm »
Yes I looked.  Still wrapping my head around all the feedback I've been getting from everybody.
7
great job ...
that's what i need ...
thanks alot, roy
8
Here is the revised code. Mind that the code does not handle the special behaviour of nested entities on layer "0".
Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun _Conv_Pickset_To_EnameList (ss / i ret)
  3.  (if ss
  4.    (repeat (setq i (sslength ss))
  5.      (setq ret (cons (ssname ss (setq i (1- i))) ret))
  6.    )
  7.  )
  8. )
  9.  
  10. (defun c:CombineLayers (/ N_Modify cLyrNme blkLst blks doc lyrs ss)
  11.  
  12.  (defun N_Modify (obj / blk lyr)
  13.    (setq lyr (vla-item lyrs (vla-get-layer obj)))
  14.    (vla-put-layer obj cLyrNme)
  15.    (if (= 256 (vla-get-color obj))
  16.      (vla-put-color obj (vla-get-color lyr))
  17.    )
  18.    (if (= "BYLAYER" (strcase (vla-get-linetype obj)))
  19.      (vla-put-linetype obj (vla-get-linetype lyr))
  20.    )
  21.    (if (= -1 (vla-get-lineweight obj))
  22.    )
  23.    (if
  24.      (and
  25.        (vlax-property-available-p obj 'hasattributes)
  26.        (= :vlax-true (vla-get-hasattributes obj))
  27.      )
  28.      (foreach att (vlax-invoke obj 'getattributes)
  29.        (N_Modify att)
  30.      )
  31.    )
  32.    (if
  33.      (and
  34.        (= "AcDbBlockReference" (vla-get-objectname obj))
  35.        (not (vl-position (setq blk (vla-item blks (vla-get-name obj))) blkLst))
  36.      )
  37.      (setq blkLst (append blkLst (list blk)))
  38.    )
  39.  )
  40.  
  41.  (if (setq ss (ssget))
  42.    (progn
  43.      (if (= (logand (getvar 'undoctl) 8) 8)
  44.        (vla-endundomark doc)
  45.      )
  46.      (vla-startundomark doc)
  47.      (setq lyrs (vla-get-layers doc))
  48.      (setq blks (vla-get-blocks doc))
  49.      (setq cLyrNme (getvar 'clayer))
  50.      (foreach obj (mapcar 'vlax-ename->vla-object (_Conv_Pickset_To_EnameList ss))
  51.        (N_Modify obj)
  52.      )
  53.      (while blkLst
  54.        (if (= :vlax-false (vla-get-isxref (car blkLst)))
  55.          (vlax-for obj (car blkLst)
  56.            (N_Modify obj)
  57.          )
  58.        )
  59.        (setq blkLst (cdr blkLst))
  60.      )
  61.      (vla-endundomark doc)
  62.    )
  63.  )
  64.  (princ)
  65. )
9
AutoLISP (Vanilla / Visual) / Re: AutoCAD / Rhino coordination
« Last post by dgorsman on February 05, 2016, 01:28:22 pm »
10
AutoLISP (Vanilla / Visual) / Re: AutoCAD / Rhino coordination
« Last post by rye guy on February 05, 2016, 11:46:32 am »
I'm not that familiar with the Rhino/SketchUp api's but I don't think there is any 'automatic' way to keep both app's synced together.

As far as sharing data, that is indeed do-able. I would suggest export/import of a textual format such as JSON, XML or your own. Text is easy to read and parse and there are already libraries for JSON and XML that are more than good enough. DXF is an option as well as most CAD packages can deal with that but it won't give you the smarts to create a 3D object from a 2d block, you will need to interpret the block data and construct your 3d object from that.
Once you decide on your data format for collaboration you will then need to create an interface for both applications to read and write the data into/from each other (or just from 2d to 3d if that's all you need).

Another question begs though, why not just create the 3d model in AutoCAD? This way you could have an auto update feature.

So this sounds like if I can write the coordinates of a bock in AutoCAD to a XML file, I can use an interface in SketchUp or Rhino to import those coordinates and swap out that AutoCAD block for a SketchUp component?

Sounds simple in theory, I need to figure out where I can learn how to write XML files.
Pages: [1] 2 3 ... 10