CoCreate Modeling: Listing parts in Annotation views

The Integration Kit also has quite a number of inquiries which help with traversing the structure of a drawing. However, it can be a little tricky to get this right because of the involved data structures. Here is some code to get you started - it inquires the current viewset and, for each view in the viewset, lists the 3D parts which are in the component lists of those views.

;; -*-Lisp-*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Description:  List parts in Annotation views
;; Author:       Claus Brod  
;; Language:     Lisp
;;
;; (C) Copyright 2006 Claus Brod, all rights reserved
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
(in-package :clausbrod.de)
(use-package :oli)

;; list all 3D parts in the component list of an Annotation view
(defun list-parts-in-view(view)
  (let ((viewstruct (oli:sd-am-inq-view (getf view :view-2d))))
    (display (format nil "~%Parts in view ~A:~%"
           (oli:sd-inq-obj-pathname (getf view :view-3d))))
    (when viewstruct
      (dolist (comp (sd-am-view-struct-parts-3d viewstruct))
        (display (oli:sd-inq-obj-pathname comp))))))

;; traverse all views in viewset
(defun list-parts-in-viewset(viewset)
  (let ((viewsetstruct (sd-am-inq-view-set viewset)))
    (dolist (view (sd-am-view-set-struct-views viewsetstruct))
      (list-parts-in-view view))))

;; start from current viewset
(setf currviewset (oli:sd-am-inq-curr-view-set))
(list-parts-in-viewset currviewset)

-- ClausBrod - 23 Jan 2006


When asked for a TWiki account, use your own or the default TWikiGuest account.

to top

You are here: CoCreateModeling > OsdmMacros > MacroPartsInAnnotationViews

r1.6 - 30 Jul 2021 - 14:35 - ClausBrod to top

CoCreateModeling
CoCreate ModelingRSS
FAQ
  Introduction
  Hardware
  Operating system
  Memory management
  File handling
  Installation
  Licensing
  Graphics
  App. knowhow
  Lisp
    Learning
    Programming
    Debugging
    DDE
    Compiler
    Customization
  Troubleshooting
  Links
Code examples
Viewbench
News
Changes
Index
Search
Impressum
Home

  • My links
  • Show me topics of interest

TWiki

Welcome


TWiki Web TWiki Web Home Changes Topics Index Search


TWiki Webs Atari Blog Main OneSpaceModeling? Sandbox TWiki TWiki Webs Atari Blog Main OneSpaceModeling? Sandbox TWiki

Jump:

Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback