Author Topic: Can you Filter Featurelines by names?  (Read 4548 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Can you Filter Featurelines by names?
« on: January 30, 2020, 10:19:39 AM »
I have been playing around with the arc connector and importing GIS information into a drawing by using feature lines. However, it does not place them on a layer. I was wondering if there is a way to filter feature lines by name and place it on layer.

But, I don't think I can select it.

Thanks for any input.
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Can you Filter Featurelines by names?
« Reply #1 on: January 30, 2020, 10:31:21 AM »
You can use Qselect, Featureline, by property Name, using Wildcard match,

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Can you Filter Featurelines by names?
« Reply #2 on: January 30, 2020, 11:00:29 AM »
Thanks Jeff for showing me that. That does help! The last question I have; is there a way to use this in a lisp type file?
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Can you Filter Featurelines by names?
« Reply #3 on: January 30, 2020, 12:53:38 PM »
This does, through lisp, what the Qselect does:
Code - Auto/Visual Lisp: [Select]
  1. (defun featurelines_by_name (name / ss idx ent fl newss)
  2.   (if (setq ss (ssget '((0 . "AECC_FEATURE_LINE"))))
  3.     (progn
  4.       (setq newss (ssadd)
  5.             idx -1)
  6.       (while (setq ent (ssname ss (setq idx (1+ idx))))
  7.         (setq fl (vlax-ename->vla-object ent))
  8.         (if (wcmatch (vlax-get fl "name") name)
  9.           (ssadd ent newss)
  10.           )
  11.         )
  12.       )
  13.     )
  14.   (sssetfirst nil newss)
  15.   newss
  16.   )

You would use it like so to find all featurelines with a name ending with "2":
(featurelines_by_name "*2")

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Can you Filter Featurelines by names?
« Reply #4 on: January 30, 2020, 12:57:19 PM »
I should note that it sets the Pickfirst selection set to the desired featurelines and returns that ss for use in the calling code if needed.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Can you Filter Featurelines by names?
« Reply #5 on: January 30, 2020, 01:02:01 PM »
Jeff

I think you are heading the direction I like to go with this.

Thanks again!!
« Last Edit: January 30, 2020, 01:31:45 PM by MSTG007 »
Civil3D 2020