API - search for custom properties

I have made a routine in VBA:

Public Function CustPropFound(CustProp As Variant, model As ModelDoc2) As
Boolean
    Dim numCustProps As Long
    Dim Names As Variant

    Names = model.GetCustomInfoNames2("")
    numConfigs = model.GetCustomInfoCount2("")
    i = 0
    CustPropFound = False
    While i < numConfigs And Not CustPropFound
        If model.CustomInfo2("", Names(i)) = CustProp Then
            CustPropFound = True
        End If
        i = i + 1
    Wend
End Function

But somehow it can't detect when the Names(i) = CustProp. When looking at
the variables they look the same...

Is another way of comparing required?

John


0
John
10/12/2003 9:13:08 PM
comp.cad.solidworks 14465 articles. 0 followers. Post Follow

5 Replies
389 Views

Similar Articles

[PageSpeed] 15
Bob Hanson Wrote:

Perhaps make the CustProp a string not a variant...

Best Regards,


-- 
Bob Hanson
CEO
Custom Programming Unlimited LLC
SolidWorks Solution Partner for SW API training/consulting and SW PDM
provider
www.cpuandsimplepdm.com website
(Home of SW API Public Code snippets)

SW World User Conference Exhibitor Booth #407


"John" <john@swnewsnomail.com> wrote in message
news:3f89c3e4$0$27402$edfadb0f@dread16.news.tele.dk...
> I have made a routine in VBA:
>
> Public Function CustPropFound(CustProp As Variant, model As ModelDoc2) As
> Boolean
>     Dim numCustProps As Long
>     Dim Names As Variant
>
>     Names = model.GetCustomInfoNames2("")
>     numConfigs = model.GetCustomInfoCount2("")
>     i = 0
>     CustPropFound = False
>     While i < numConfigs And Not CustPropFound
>         If model.CustomInfo2("", Names(i)) = CustProp Then
>             CustPropFound = True
>         End If
>         i = i + 1
>     Wend
> End Function
>
> But somehow it can't detect when the Names(i) = CustProp. When looking at
> the variables they look the same...
>
> Is another way of comparing required?
>
> John
>
>


0
Robert
10/12/2003 11:36:51 PM
.... I already did that (which I should have said...) and it doesn't work
either. So what then?

"Robert Hanson" <roberth@cpuandsimplepdm.com> wrote in message
news:nAlib.174163$0v4.13371309@bgtnsc04-news.ops.worldnet.att.net...
> Bob Hanson Wrote:
>
> Perhaps make the CustProp a string not a variant...
>
> Best Regards,
>
>
> -- 
> Bob Hanson
> CEO
> Custom Programming Unlimited LLC
> SolidWorks Solution Partner for SW API training/consulting and SW PDM
> provider
> www.cpuandsimplepdm.com website
> (Home of SW API Public Code snippets)
>
> SW World User Conference Exhibitor Booth #407
>
>
> "John" <john@swnewsnomail.com> wrote in message
> news:3f89c3e4$0$27402$edfadb0f@dread16.news.tele.dk...
> > I have made a routine in VBA:
> >
> > Public Function CustPropFound(CustProp As Variant, model As ModelDoc2)
As
> > Boolean
> >     Dim numCustProps As Long
> >     Dim Names As Variant
> >
> >     Names = model.GetCustomInfoNames2("")
> >     numConfigs = model.GetCustomInfoCount2("")
> >     i = 0
> >     CustPropFound = False
> >     While i < numConfigs And Not CustPropFound
> >         If model.CustomInfo2("", Names(i)) = CustProp Then
> >             CustPropFound = True
> >         End If
> >         i = i + 1
> >     Wend
> > End Function
> >
> > But somehow it can't detect when the Names(i) = CustProp. When looking
at
> > the variables they look the same...
> >
> > Is another way of comparing required?
> >
> > John
> >
> >
>
>


0
John
10/13/2003 9:39:49 AM
> ... I already did that (which I should have said...) and it doesn't work
> either. So what then?

> > >         If model.CustomInfo2("", Names(i)) = CustProp Then

What are you actually trying to achieve? In the code above you seem to be
comparing custom property value (model.CustomInfo2()) with variable
CustProp... If I understood right, you should have If Names(i) = CustProp
instead.

-h-


0
Heikki
10/13/2003 9:45:25 AM
Yep... just found that myself. Embarrassing....

"Heikki Leivo" <heikki.leivo@SPAM.SUCKS.cadworks.fi> wrote in message
news:Rvuib.53$l76.4@reader1.news.jippii.net...
> > ... I already did that (which I should have said...) and it doesn't work
> > either. So what then?
>
> > > >         If model.CustomInfo2("", Names(i)) = CustProp Then
>
> What are you actually trying to achieve? In the code above you seem to be
> comparing custom property value (model.CustomInfo2()) with variable
> CustProp... If I understood right, you should have If Names(i) = CustProp
> instead.
>
> -h-
>
>


0
John
10/13/2003 10:20:36 AM
One further note...
You may want to ensure that your comparison is case-insensitive by doing a
UCase on both sides:
If ucase(Names(i)) = ucase(CustProp)

Regards,
Brenda

-----------------------------------------------
Brenda D. Bosley
CustomSolids

"John" <john@swnewsnomail.com> wrote in message
news:U%uib.55$gW3.44@news.get2net.dk...
> Yep... just found that myself. Embarrassing....
>
> "Heikki Leivo" <heikki.leivo@SPAM.SUCKS.cadworks.fi> wrote in message
> news:Rvuib.53$l76.4@reader1.news.jippii.net...
> > > ... I already did that (which I should have said...) and it doesn't
work
> > > either. So what then?
> >
> > > > >         If model.CustomInfo2("", Names(i)) = CustProp Then
> >
> > What are you actually trying to achieve? In the code above you seem to
be
> > comparing custom property value (model.CustomInfo2()) with variable
> > CustProp... If I understood right, you should have If Names(i) =
CustProp
> > instead.
> >
> > -h-
> >
> >
>
>


0
Brenda
10/13/2003 3:49:38 PM
Reply:
Similar Artilces:

Fingerprint sensor and API
For a special software application in Visual Objects I have to 'talk' with a fingerprint sensor. Therefore I need a good API or SDK. I'm trying to find a good sensor to which I can talk by software (VO) that has a database of fingerprints. If someone puts his finger on the sensor, my VO app should receive the fingerprint (or a unique string) that I must lookup in the database. Upon match I have to send to a serial or USB device a message to open a specific door. Who has already some experience in this area? best regards, Janno snip[ has a database of finge...

Documenting custom machines
I am currently attempting to formulate a plan/procedure/convention/ whatever you want to label it, to initially document and then track changes to custom built machines that we receive in from outside vendors. The main challenge at hand is how to handle the vendors' information (e.g. CAD, electronic docs, BOM, etc.) in regard to inputing the information into our system (Windchill). The next challenge is how to track any updates/changes beyond the initial receipt of the machines and associated information. I would like to hear from anyone who has a similar situation and how they have ha...

ssl popen API
Hi, Can anyone tell me how to invoke ssl popen API from ACE? I m looking for some example and guideline for it. Thanks Sam ...

SWit 2.0 Custom Property Editor
....is out, and it's free. www.markkulehtola.net/swit.html -- regards Markku www.markkulehtola.net On 2004-09-16, Markku Lehtola <ml@markkulehtolaismydomain.net> wrote: > ...is out, and it's free. www.markkulehtola.net/swit.html > 2.1 is out with couple new options.. -- regards Markku www.markkulehtola.net ...

How to set a Java object's 'Tag' property?
I have create a GUI using the GUIDE. In it, some Java components have been used. The following is an example code I've used to creat the components: function button = createButton(hfig) % Create the button if it is not already exist. if isempty(findobj(allchild(hfig),'Tag','button')) button = com.mathworks.mwswing.MJButton('Button'); set(button,'Tag','button'); set(button,'Parent',hfig); javacomponent(button,java.awt.BorderLayout.SOUTH,hfig); end When I get(button,'Tag'), ML returns 'button',the right answer....

wxListView, m_headerWin and column headers custom colour
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello! I use wxGTK-2.6.2 on Debian GNU/Linux. I use in my frame a wxListView control with a wxLC_REPORT style. I want to custom colour the header. I tried to use the member m_headerWin: ((wxWindow*)m_lcUsers->m_headerWin)->SetBackgroundColour( *wxBLUE ); But it sets blue colour to the area outside the columns. Is it possible to set the column headers colour via m_headerWin member? My question is how can I change the colour of the headers? I appreciate any suggestions. Thanks in advance! Best regards, Petyo -----...

Game programming API compatible with BlueJ
I'd like to put together a simple game in BlueJ, but basically all of the examples on the net use J2ME. (javax.microedition.lcdui.game) To the best of my research, BlueJ and J2ME are not compatible. If this is correct, I'd like to know if there are any fairly standard J2SE game programming APIs. Features I'm looking for: Double Buffering Sprites Layers Animation Looping Background Music Sound Effects Features that would be really, really nice: Arbitrary Free Scaling Arbitrary Free Rotation Masking Alpha Blending User Modifiable Frame Buffer (scan line effects, etc) Palette Ind...

Custom lengend for a single SURF() call
I have a question related to surface plots and, particularly, coloring. My shape is a pyramid consisting of several steps. So, that for each x, y coordinate, there are two different z points, then x,y changes, while z stays the same, and the everything repeats. It's a circular 3D staircase. I would like to have different colors for each step and then have a legend displaying name for each step. Is it possible to do with one single SURF() call? Or should I call this function for every signle step so that there are N steps and N legend entries? Thank you in advance bump ...

Writing a custom YAML emitter
Hi all, I'm trying to understand how to write a custom YAML emitter. As fun and interesting as Why's documentation is, I don't quite get how to do what I need. What I'm looking for is a way of avoiding emitting certain instance variables. Say I have a class like this: class Book attr_accessor :title, :chapter_titles attr_accessor :current_page end When I save it, I want to save the permanent features like "title" and "chapter_titles", but I want to forget the current page. I think the YAML representation would be something like: --- !ruby/o...

Tabbing into a custom window #2
My problems are all solved. For anyone that's interested: 1) The tree control tab issue was my own muppetry. I had forgotten that I had overridden AcceptsFocus() to return false. The fix was to also override AcceptsFocusFromKeyboard() and return true. 2) The custom view problems were solved by using the wxWANT_CHARS flag and by firing a wxNavigationKey event in response to a WXK_TAB keydown event (obviously after all my markers have been traversed), and by handling the wxNavigationEvent, in which I give the view focus and internally set the focus item to the first marker. I&...

API: Close all open documents
I had to close all the open documents in an application I was writing. I ended up having to work this out, so thought I would share it. It's VB.NET, but could be easily modified to work in a macro or VB6. Private Function CloseAllOpenSWFiles() 'close all open docs Dim OpenDocs As SldWorks.EnumDocuments2 Dim OpenDoc As SldWorks.ModelDoc2 OpenDocs = swApp.EnumDocuments2() OpenDoc = swApp.ActiveDoc While Not OpenDoc Is Nothing Try OpenDoc.Save3(SwConst.swSaveAsOptions_e.swSaveAsOptions_SaveReferenced, 0, 0) Debug.WriteLine("Closing " & OpenDoc.GetPathName) swApp...

How can i set the root's ShowHiddenHandles property to 'on'.
Hi all, May i know how can i set the root's ShowHiddenHandles property to 'on' ? I have browsed through my GUI figure... But i still no idea how can i set the root? i tried in command window set(root, 'ShowHiddenHandles', on) but got error... Please advise ... Thank you to ppl who suffered the same problem like me.. i found the solution... hope it helps u guys http://www.mathworks.com/support/solutions/en/data/1-192W8/index.html On 3/19/2011 11:06 AM, st wrote: > Hi all, > > May i know how can i set the root's ShowHiddenHandles pro...

API and scroll bars
Hello, I am a beginner and I would like to know if there is any code to call an API to put scroll bars into my form when it is minimized. Thank You. When it's minimized? Do you mean 'only on the taskbar', where the form would not be visible, or when it's not maximized - 'normal mode'? Samir Talwar "william cline" <wilbl1@earthlink.net> wrote in message news:<_DErb.19397$Oo4.4045@newsread1.news.atl.earthlink.net>... > Hello, > I am a beginner and I would like to know if there is any code to call an > API to put scrol...

API to capture audio from computer, libspeex API, PortAudio API ...?
I want to extract audio from a computer, pc or Mac to start with (maybe later on Smartphones, tablets). I may want to have start/stop recording button as well. There seems a lot of APIs - libspeex API, PortAudio API ... Xuggle API...? I am wondering what might be an optimal choice - better performance - trouble free implementation? Currently the preference is to extract in wav format. I am using a Ubuntu VM on a Win7 for dev. Hi, portaudio is nice as it's crossplatform. That's what I'd use (did so the last time on a Raspberry Pi, even though the sound is noth...

customizing indentation
I am using the report class. The first line of text that follows the section heading is not indented; I want to leave it that way. However, I want the first line of text immediately following the subsection, subsubsection, and paragraph to be indented. (I have to follow a set style provided to me.) indentfirst.sty indents ALL first lines of text, which isn't what I want. Is there a package that will do this for me or is there some way to set this up? I do a lot of work with LaTeX but not as much with TeX, so customizing is more difficult for me. Seems like there should be a \@after...

API:create & persistent
Extract of API page. "persistent global local A flag for whether the create form should be persistent or not. If persistent, then after a successful create it will stay open. Default is false." Am i right in thinking that setting 'persistent = true' in Activescaffold DO config loop Viz. 'extract: ActiveScaffold.set_defaults do |config config.create.persistent = true .........other stuff.......... end # of config should re-display the create form (the data-entry form) in Rails version 2.3.4 ? Or is it somehow limited to certain versions of ActiveScaffo...

Agility for APIs and data documents
Hi all, With Agile code writing, one of the main concepts is to avoid thinking ahead, or doing things because you might need them later (YAGNI), but I'm having some trouble where code engineering intersects with published APIs and data document design. With XML documents, for instance, one of the common pieces of advice (right or wrong) is that data lives longer than applications, so for instance, even if only one of the first 2 applications that will use a document schema knows anything about act actual dates, one might want to include optional actual date attributes in the spec., and h...

RE: python API wrapper for C++ API #2
Thanks Josiah and everyone else who's replied to this already. I'm taking a look at the web site Fredrik posted and I think it's going to help me a lot. I think I only need to be able to call C++ from Python. The main thing I'm confused about is how to make it so the Python program will directly manipulate objects in the 3D program. My brother has used Jython and he said in there, the Python Interpreter is an object and you can bind it to an object. I'm not sure how this would happen in C++ though. Thanks, Mark -----Original Message----- From: Josiah Carlson [mailto:...

download bioruby API document
Hi all, How do I download/install API document for Bioruby after installing Bioruby? Thanks, Li ____________________________________________________________________________________ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 ...

api c
Hi everybody, Someone knows were i can find a Lotus Notes C API ? thanx Normunds Kalnberzins has written a very good book about using the C-API with LotusScript. You can find information at his website: http://www.ls2capi.com IBM/Lotus has documentation on the support website, too. Tim Mohrl´┐Żnt - tmohrlant@NO_JUNK_MAIL_comcast.net (remove NO_JUNK_MAIL_) "franck.thibault" <franck.thibault@free.fr> wrote in message news:40b6708c$0$12751$636a15ce@news.free.fr... > Hi everybody, > > Someone knows were i can find a Lotus Notes C API ? > &g...

Writing a custom libc
where can I get the pieces needed to write a custom C library? I ask because I'm working on a rather large set of libraries where the extra stuff in glibc is a waste of space. Levi Campbell wrote: > where can I get the pieces needed to write a custom C library? I ask > because I'm working on a rather large set of libraries where the extra > stuff in glibc is a waste of space. > Eh? Not including stuff you don't use is the linker's job. -- Ian Collins. Ian Collins wrote: > Levi Campbell wrote: > >>where can I get the pieces needed to write a cust...

Can MAYA C++ stand-alone API with GUI run without MAYA launched? #2
Hello, I am wondering if a C++ stand-alone API with GUI (created with MEL script, maybe) can run in Windows system without MAYA software running? I need to have a GUI acting as a control panel to control the animation, but I am not sure if I can use the C++ API to 1. create a GUI, with MEL script, as a control panel ? 2. create animation in a "Windows'"window (not MAYA's window)? I hope to use MAYA library, instead of OPENGL, to write the application, but I hope I can see the GUI and animation in Windows environment, even the MAYA software is not running. Could...

api
Dear all, I have some simple questions because i dont' understand because there aren't clear samples in google I have a problems to find some complete ansi c code (win32api), not c+ +, to write a little functions in ansi c. For example a stupid AddPrinter (win32 function), i have read msdn but there is only parameters, return values etc etc. I read that i must use PRINTER_INFO_2 structure, but i dont have find a complete code in google that merge both, Is not possible that no-one have written a complete sample...in ansi c. Probably i wrong a keyword.. thanks Sorry for th...

Develop API for my cpp app
Hi How to develop API for my C++ application if i want to use it something like an engine from perl and python? Thanks. n0xi0uzz wrote: > How to develop API for my C++ application if i want to use it > something like an engine from perl and python? What is your C++ *language* question, again? For general inquiries about software development, consider 'comp.software-eng' newsgroup. V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask On Oct 1, 9:20=A0pm, n0xi0uzz <n0xi0...@gmail.com> wrote: >...

advanced customization of plots and figures
Hi community, i want to format a figure to look just like this example: http://picasaweb.google.com/babouyukas/ExampleGrafix/photo#5112210045444665938 very important for me is the format of the "Box". in my plotting script i use the command "box on". this makes a box with the same width all around the graphic. i need the axes to have different width. the second problem is the grid and specially the minor tics (see the example, the gray lines only in the x-axis). is it possible to format them in a different way than the main tics? thank you very much! tom "Tom?...