TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V@no on April 27, 2024, 09:59:59 AM

Title: Periodic flag in a spline doesn't match periodic value shown in properties?
Post by: V@no on April 27, 2024, 09:59:59 AM
I've been playing around with group 70 (https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-E1F884F8-AA90-4864-A215-3182D47A9C74#GUID-E1F884F8-AA90-4864-A215-3182D47A9C74__WSFACF1429558A55DEC759DDFFB0EBA947-4A9F) of a spline and noticed that "periodic" bit (bit 2) could be set, but spline's properties panel shows it as not set:

Code - Auto/Visual Lisp: [Select]
  1. (logand (cdr (assoc 70 (entget (SSNAME (ssget ":S" '((0 . "SPLINE"))) 0)))) 2)

(https://i.imgur.com/nwjKc7i.png?1)
Why is that?

Thanks.
Title: Re: Periodic flag in a spline doesn't match periodic value shown in properties?
Post by: It's Alive! on April 27, 2024, 10:36:43 PM
PyRx shows False

Code - Python: [Select]
  1. import traceback
  2. from pyrx_imp import Rx, Ge, Gi, Db, Ap, Ed, Gs
  3.  
  4. def PyRxCmd_doit() -> None:
  5.     try:
  6.         db = Db.curDb()
  7.         es = Ed.Editor.entSel("\nPick it: ", Db.Spline.desc())
  8.         if es[0] != Ed.PromptStatus.eOk:
  9.             raise Exception("Oops {}: ".format(es[0]))
  10.         sp = Db.Spline(es[1])
  11.         print("isPeriodic= ",sp.isPeriodic())
  12.     except Exception as err:
  13.         traceback.print_exception(err)
  14.  

Quote
Command: DOIT
Pick it: isPeriodic=  False