Recent Posts

Pages: [1] 2 3 ... 10
1
AutoLISP (Vanilla / Visual) / Re: Square - Rectangle lisp
« Last post by domenicomaria on Today at 04:02:39 AM »
Topographer
you say :
"The rectangle is two triangles with angles in degrees (90,60,30)"

But this is NOT TRUE.
It could be so, but it is not the rule.

If you want that
"the rectangle is two triangles with angles in degrees (90,60,30)"
the code that i wrote
is the almost the solution
(because there is also the mirrored solution)
2
ARX Programming / Re: std::unique_ptr for DB objects... or bad idea
« Last post by MickD on Today at 12:23:41 AM »
toight :)
3
of course this may change in a few weeks  :lmao:
4
Iíve been using AcDbObjectPointer for dbobjects and std::unique_ptr for iterators (and everything else)

Code - C++: [Select]
  1. //
  2. template<typename IteratorType>
  3. constexpr auto makeIterator = [](const auto& record)
  4. {
  5.    IteratorType *pIter = nullptr;
  6.    Acad::ErrorStatus es = record.newIterator(pIter);
  7.    return std::make_tuple(es, std::unique_ptr<IteratorType>(pIter));
  8. };
  9. constexpr auto makeBlockTableIterator = makeIterator<AcDbBlockTableIterator>;
  10. constexpr auto makeBlockTableRecordIterator = makeIterator<AcDbBlockTableRecordIterator>;
  11.  
  12.  
  13. //
  14.   if (AcDbBlockTablePointer pBt(blockTableId, AcDb::kForRead); pBt.openStatus() == eOk)
  15.    {
  16.        if (auto[es, btTter] = makeBlockTableIterator(*pBt); es == eOk)
  17.        {
  18.            for (btTter->start(); !btTter->done(); btTter->step())
  19.            {
  20.               ...
  21.            }
  22.        }
  23.    }
  24.  

and I have been passing by refrence

Code - C++: [Select]
  1.  
  2.    void woohoo(AcDbObjectId id)
  3.    {
  4.        if (AcDbObjectPointer<AcDbLine> pLine(id); pLine.openStatus() == eOk)
  5.        {
  6.            yahoo(*pLine);
  7.        }
  8.    }
  9.  
  10.    Acad::ErrorStatus yahoo(AcDbLine& line)
  11.    {
  12.        AcString layer;
  13.        return line.layer(layer);
  14.    }
  15.  
5
AutoLISP (Vanilla / Visual) / Re: Square - Rectangle lisp
« Last post by BIGAL on May 24, 2019, 08:34:38 PM »
Like you ronjonp 3 answers actually 4 say left right ortho and square. for 1st 3 enter length of other side, need 2 knowns.
6
AutoLISP (Vanilla / Visual) / Re: Subtract Name from Entity
« Last post by BIGAL on May 24, 2019, 08:27:01 PM »
A vl answer also

Code: [Select]
(setq obj (vlax-ename->vla-object (car (entsel "pick object"))))
(setq name (vla-get-name obj))
7
AutoLISP (Vanilla / Visual) / Re: How to extend or cut?
« Last post by BIGAL on May 24, 2019, 08:24:01 PM »
Try this

Code: [Select]
; defun trim inside circles
; By Alan H May 2019 AlanH Consulting
; www.alanh.com.au


(defun aH:trimcircles (/ ss ang rad oldsnap oldaunits obj lay)

  (setq oldsnap (getvar "osmode"))
  (setq oldaunits (getvar 'aunits))
 
  (setq lay (cdr (assoc 8 (entget (car (entsel "Pick circle"))))))
  (setq ss (ssget (list (cons 0 "Circle") (cons 8 lay))))
 
  (setvar 'osmode 0)
  (setvar 'aunits 3)
 
  (repeat (setq x (sslength ss))
    (setq obj (entget (ssname ss (setq x (- x 1)))))
    (setq rad (cdr (assoc 40 obj)))
    (setq cenpt (list (nth 1 (assoc 10 obj)) (nth 2 (assoc 10 obj))))
    (setq ent (cdr (assoc -1 obj)))
    (setq rad (- rad 3))
    (setq lst '())
    (setq ang 0.0)
   
    (repeat 10
      (setq lst (cons (polar cenpt ang rad) lst))
      (setq ang (+ ang 0.62831853))
    )
   
    (command "trim" ent "" "fence")
    (while (= (getvar "cmdactive") 1)
      (repeat (setq y (length lst))
        (command (nth (setq y (- y 1)) lst))
      )
      (command "" "")
    )
  )

  (setvar 'osmode oldsnap)
  (setvar 'aunits oldaunits)

)

(aH:trimcircles)

(defun c:trci () (aH:trimcircles))
8
ARX Programming / Re: std::unique_ptr for DB objects... or bad idea
« Last post by MickD on May 24, 2019, 07:08:55 PM »
Still brushing up on my C++ but when I first read about the new smart pointers this was the first place I thought about using them (i.e. in some ObjectARX).

I guess it depends on the size of your function and how many 'new' pointers you have to manage, then again they would be used quite a bit in many functions so I think yes, good idea :)
9
CAD General / Re: Civil 3D reports and XSLT formatting
« Last post by Cyberflow on May 24, 2019, 02:14:47 PM »
Well, i guess that C3D use's the same XML schema has LandXML ?

Didn't tought of that, i guess i'm dure then due for my weekend.
10
CAD General / Re: Civil 3D reports and XSLT formatting
« Last post by Peter2 on May 24, 2019, 10:51:06 AM »
To you mean the LandXML - data?

http://www.landxml.org/

--
Pages: [1] 2 3 ... 10